diff --git a/cfg/std.cfg b/cfg/std.cfg index 6eaa28a05..35e4a0f1b 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -1480,9 +1480,6 @@ false - - - diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 05b059a50..fc5a089c8 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -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() {