diff --git a/cfg/posix.cfg b/cfg/posix.cfg index b8dc27a92..bcd726a88 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -711,6 +711,12 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + + + + + + diff --git a/test/cfg/generated-cfg-tests-posix.cpp b/test/cfg/generated-cfg-tests-posix.cpp index 4b676b9c6..fdd817a5f 100644 --- a/test/cfg/generated-cfg-tests-posix.cpp +++ b/test/cfg/generated-cfg-tests-posix.cpp @@ -1529,26 +1529,37 @@ void test__unlink__arg1__notuninit() { void test__rename__noreturn() { int x = 1; - if (cond) { x=100; rename(arg1); } + if (cond) { x=100; rename(arg1, arg2); } // cppcheck-suppress shiftTooManyBits x = 1 << x; } void test__rename__leakignore() { char *p = malloc(10); *p=0; - rename(p); + rename(p, arg2); // cppcheck-suppress memleak } void test__rename__arg1__notnull() { // cppcheck-suppress nullPointer - rename(NULL); + rename(NULL, arg2); } void test__rename__arg1__notuninit() { int x[10]; // cppcheck-suppress uninitvar - rename(x); + rename(x, arg2); +} + +void test__rename__arg2__notnull() { + // cppcheck-suppress nullPointer + rename(arg1, NULL); +} + +void test__rename__arg2__notuninit() { + int x[10]; + // cppcheck-suppress uninitvar + rename(arg1, x); } void test__stat__noreturn() {