From 0e4a17e2ab7722ad92f7c67b17f3b1b95c141b69 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 1 May 2022 14:08:08 +0200 Subject: [PATCH] posix.cfg: Improved configuration of readlinkat(). --- cfg/posix.cfg | 2 ++ test/cfg/posix.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index d4a5e3156..47fbe9cd1 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -3906,6 +3906,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + @@ -3914,6 +3915,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + 0: diff --git a/test/cfg/posix.c b/test/cfg/posix.c index aed88f778..3f72c51fb 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -32,6 +32,15 @@ #include #include +int nullPointer_readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz) +{ + // cppcheck-suppress nullPointer + (void) readlinkat(dirfd, NULL, buf, bufsiz); + // cppcheck-suppress nullPointer + (void) readlinkat(dirfd, pathname, NULL, bufsiz); + return readlinkat(dirfd, pathname, buf, bufsiz); +} + ssize_t nullPointer_recv(int sockfd, void *buf, size_t len, int flags) { // cppcheck-suppress nullPointer