Skip to content

Commit

Permalink
posix.cfg: Improved configuration for send().
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Apr 27, 2022
1 parent 9726dc8 commit b2c3a9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cfg/posix.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
7 changes: 7 additions & 0 deletions test/cfg/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b2c3a9e

Please sign in to comment.