posix.cfg: Fixed FP for getcwd().First and second parameter is allowed to be zero.

This commit is contained in:
Martin Ettl 2014-05-02 04:56:12 +02:00
parent 5a23b739da
commit b363d0641a
2 changed files with 4 additions and 2 deletions

View File

@ -9,8 +9,7 @@
<function name="mktemp"> <noreturn>false</noreturn> <arg nr="1"><not-uninit/><not-null/></arg> <leak-ignore/> </function>
<function name="getcwd">
<noreturn>false</noreturn>
<arg nr="1"><not-null/></arg>
<arg nr="2"><not-uninit/><not-null/></arg>
<arg nr="2"><not-uninit/></arg>
<leak-ignore/>
</function>
<function name="mkdir">

View File

@ -2615,6 +2615,9 @@ private:
check("void f(char *p){ int i = 0; mkdir (p, i);}");
ASSERT_EQUALS("",errout.str());
check("void f(){ getcwd (0, 0);}");
ASSERT_EQUALS("",errout.str());
check("void f(char *p){ mkdir (p, *0);}");
ASSERT_EQUALS("[test.cpp:1]: (error) Null pointer dereference\n",errout.str());
}