From 01a24d2ce0940a4aa904a21eb540b26faacea9ec Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 1 May 2022 12:27:14 +0200 Subject: [PATCH] posix.cfg: Improved configuration of recv(). --- cfg/posix.cfg | 1 + test/cfg/posix.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 61a3faee1..2e6981777 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2261,6 +2261,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 c164e60c6..aed88f778 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -32,6 +32,13 @@ #include #include +ssize_t nullPointer_recv(int sockfd, void *buf, size_t len, int flags) +{ + // cppcheck-suppress nullPointer + (void) recv(sockfd, NULL, len, flags); + return recv(sockfd, buf, len, flags); +} + ssize_t nullPointer_recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen) {