posix.cfg: Improved configuration of readlinkat().

This commit is contained in:
orbitcowboy 2022-05-01 14:08:08 +02:00
parent 5db6fc1f54
commit 0e4a17e2ab
2 changed files with 11 additions and 0 deletions

View File

@ -3906,6 +3906,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<not-uninit/>
</arg>
</function>
<!-- https://man7.org/linux/man-pages/man2/readlink.2.html -->
<!-- int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz); -->
<function name="readlinkat">
<returnValue type="int"/>
@ -3914,6 +3915,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
<arg nr="1" direction="in">
<not-uninit/>
<not-bool/>
<valid>0:</valid>
</arg>
<arg nr="2" direction="in">
<not-null/>

View File

@ -32,6 +32,15 @@
#include <wchar.h>
#include <string.h>
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