#6306 false positive with strxfrm NULL argument. Adjust std.cfg in favor of no false positive

This commit is contained in:
Alexander Mai 2014-12-07 15:24:27 +01:00
parent 64e6b5186d
commit d11eb4931a
2 changed files with 7 additions and 3 deletions

View File

@ -1480,9 +1480,6 @@
<function name="strxfrm">
<noreturn>false</noreturn>
<leak-ignore/>
<arg nr="1">
<not-null/>
</arg>
<arg nr="2">
<not-null/>
<not-uninit/>

View File

@ -2575,6 +2575,13 @@ private:
check("void f() { strtok(NULL, 'x');}");
ASSERT_EQUALS("",errout.str());
// #6306 "false positive with strxfrm NULL argument"
check("void foo(void) { size_t res = strxfrm(NULL, \"foo\", 0); }");
ASSERT_EQUALS("",errout.str());
check("void foo(void) { size_t res = strxfrm(NULL, \"foo\", 42); }");
TODO_ASSERT_EQUALS("[test.cpp:1]: (error) Null pointer dereference\n", "", errout.str());
}
void nullpointerFputc() {