posix.cfg: Improved configuration for send().

This commit is contained in:
orbitcowboy 2022-04-27 10:41:57 +02:00
parent 9726dc8174
commit b2c3a9e9a3
2 changed files with 10 additions and 0 deletions

View File

@ -2306,16 +2306,19 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-uninit/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3" direction="in">
<not-uninit/>
<valid>0:</valid>
</arg>
<arg nr="4" direction="in">
<not-uninit/>
<not-bool/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man3/sendto.3p.html -->
<!-- ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
const struct sockaddr *dest_addr, socklen_t addrlen); -->
<function name="sendto">

View File

@ -601,6 +601,13 @@ void validCode(va_list valist_arg1, va_list valist_arg2)
}
}
ssize_t nullPointer_send(int socket, const void *buf, size_t len, int flags)
{
// cppcheck-suppress nullPointer
(void) send(socket, NULL, len, flags);
return send(socket, buf, len, flags);
}
ssize_t nullPointer_sendto(int socket, const void *message, size_t length,
int flags, const struct sockaddr *dest_addr,
socklen_t dest_len)