From 50aa3620da6eeec746344b5051f4aa3b67f44f7d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 9 May 2018 18:20:45 +0200 Subject: [PATCH] posix.cfg: Add minsize to readlink[at] function configurations (#1216) --- cfg/posix.cfg | 2 ++ test/cfg/posix.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index e651badf2..97efe015c 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -2443,6 +2443,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + @@ -2464,6 +2465,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index d947c8201..7e711f16d 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -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)