#6306 false positive with strxfrm NULL argument. Adjust std.cfg in favor of no false positive
This commit is contained in:
parent
64e6b5186d
commit
d11eb4931a
|
@ -1480,9 +1480,6 @@
|
||||||
<function name="strxfrm">
|
<function name="strxfrm">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
<arg nr="1">
|
|
||||||
<not-null/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="2">
|
<arg nr="2">
|
||||||
<not-null/>
|
<not-null/>
|
||||||
<not-uninit/>
|
<not-uninit/>
|
||||||
|
|
|
@ -2575,6 +2575,13 @@ private:
|
||||||
|
|
||||||
check("void f() { strtok(NULL, 'x');}");
|
check("void f() { strtok(NULL, 'x');}");
|
||||||
ASSERT_EQUALS("",errout.str());
|
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() {
|
void nullpointerFputc() {
|
||||||
|
|
Loading…
Reference in New Issue