posix.cfg: Fixed FP for getcwd().First and second parameter is allowed to be zero.
This commit is contained in:
parent
5a23b739da
commit
b363d0641a
|
@ -9,8 +9,7 @@
|
||||||
<function name="mktemp"> <noreturn>false</noreturn> <arg nr="1"><not-uninit/><not-null/></arg> <leak-ignore/> </function>
|
<function name="mktemp"> <noreturn>false</noreturn> <arg nr="1"><not-uninit/><not-null/></arg> <leak-ignore/> </function>
|
||||||
<function name="getcwd">
|
<function name="getcwd">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
<arg nr="1"><not-null/></arg>
|
<arg nr="2"><not-uninit/></arg>
|
||||||
<arg nr="2"><not-uninit/><not-null/></arg>
|
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
</function>
|
</function>
|
||||||
<function name="mkdir">
|
<function name="mkdir">
|
||||||
|
|
|
@ -2615,6 +2615,9 @@ private:
|
||||||
check("void f(char *p){ int i = 0; mkdir (p, i);}");
|
check("void f(char *p){ int i = 0; mkdir (p, i);}");
|
||||||
ASSERT_EQUALS("",errout.str());
|
ASSERT_EQUALS("",errout.str());
|
||||||
|
|
||||||
|
check("void f(){ getcwd (0, 0);}");
|
||||||
|
ASSERT_EQUALS("",errout.str());
|
||||||
|
|
||||||
check("void f(char *p){ mkdir (p, *0);}");
|
check("void f(char *p){ mkdir (p, *0);}");
|
||||||
ASSERT_EQUALS("[test.cpp:1]: (error) Null pointer dereference\n",errout.str());
|
ASSERT_EQUALS("[test.cpp:1]: (error) Null pointer dereference\n",errout.str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue