posix.cfg: Add minsize to readlink[at] function configurations (#1216)

This commit is contained in:
Sebastian 2018-05-09 18:20:45 +02:00 committed by GitHub
parent c39e3467a4
commit 50aa3620da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -2443,6 +2443,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
</arg>
<arg nr="2">
<not-null/>
<minsize type="argvalue" arg="3"/>
</arg>
<arg nr="3">
<not-uninit/>
@ -2464,6 +2465,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
</arg>
<arg nr="3">
<not-null/>
<minsize type="argvalue" arg="4"/>
</arg>
<arg nr="4">
<not-uninit/>

View File

@ -42,6 +42,12 @@ void bufferAccessOutOfBounds(int fd)
sendto(fd,a,6,0,0x0,0x0);
// cppcheck-suppress constStatement
0;
readlink("path", a, 5);
// cppcheck-suppress bufferAccessOutOfBounds
readlink("path", a, 6);
readlinkat(1, "path", a, 5);
// cppcheck-suppress bufferAccessOutOfBounds
readlinkat(1, "path", a, 6);
}
void nullPointer(char *p, int fd)