diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 9521a08b4..d14413c98 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2326,6 +2326,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s 0: + @@ -2335,9 +2336,13 @@ 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 df1164cb1..53699eb52 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -601,6 +601,16 @@ void validCode(va_list valist_arg1, va_list valist_arg2) } } +ssize_t nullPointer_sendto(int socket, const void *message, size_t length, + int flags, const struct sockaddr *dest_addr, + socklen_t dest_len) +{ + // cppcheck-suppress nullPointer + (void) sendto(socket, NULL, length, flags, dest_addr, dest_len); + (void) sendto(socket, message, length, flags, NULL, dest_len); + return sendto(socket, message, length, flags, dest_addr, dest_len); +} + void bufferAccessOutOfBounds(int fd) { char a[5];