diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 4064dc9d5..b8dc27a92 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -1834,17 +1834,8 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s - - - false - - - - - - - - + Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 22df7c1ff..4070a7a17 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -75,6 +75,9 @@ void nullPointer(char *p, int fd) // cppcheck-suppress leakReturnValNotUsed // cppcheck-suppress nullPointer fdopen(fd, NULL); + // cppcheck-suppress strtokCalled + // cppcheck-suppress nullPointer + strtok(p, NULL); } void memleak_getaddrinfo() @@ -239,6 +242,11 @@ void uninitvar(int fd) // cppcheck-suppress leakReturnValNotUsed // cppcheck-suppress uninitvar fdopen(x, "rw"); + + char *strtok_arg1; + // cppcheck-suppress strtokCalled + // cppcheck-suppress uninitvar + strtok(strtok_arg1, ";"); } void uninitvar_getcwd(void)