From bfbc7e154906d92b976d6bc950ae574aada770df Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 26 Apr 2022 10:04:15 +0200 Subject: [PATCH] posix.cfg: Added support for getlogin_r(). --- cfg/posix.cfg | 17 +++++++++++++++++ test/cfg/posix.c | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index fd393d405..a4eedcefe 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -4646,6 +4646,23 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s Non reentrant function 'getlogin' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getlogin_r'. + + + + + + false + + + + + + + + + 0: + + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 36daa93e4..80153087c 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -31,6 +31,13 @@ #include #include +int nullPointer_getlogin_r(char *buf, size_t bufsize) +{ + // cppcheck-suppress nullPointer + (void)getlogin_r(NULL,bufsize); + return getlogin_r(buf,bufsize); +} + ssize_t uninitvar_pread(int fd, void *buf, size_t nbyte, off_t offset) { int Fd;