Menu

#46 Possible Null Dereferencing Not Recognized

open
nobody
None
5
2007-07-04
2007-07-04
Anonymous
No

Source code :
char firstchar1(char *s)
{
return *s;
}

char firstchar2(char *s)
{
if(s==NULL)
return *s;
else
return '0';
}

while running splint as
./splint +null func.c or
./splint func.c

both time output of splint is same and output is:

Splint 3.1.1 --- 28 Apr 2003

Finished checking --- no warnings

-----
splint must show warning msg : Dereferencing possibly null pointer.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB