ivakyb / minini

Automatically exported from code.google.com/p/minini
Other
0 stars 0 forks source link

Error with static analysis #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please find below error found by a static analysis tool:

NPD.CHECK.MUST: Pointer 'ep' checked for NULL at line 213 will be dereferenced 
at line 214. : C and C++ : minIni.c : Critical (1) : Analyze : Local
  214

NPD.CONST.DEREF: Constant NULL pointer is dereferenced at line 520. : C and C++ 
: minIni.c : Critical (1) : Analyze : Local
520
NPD.CONST.DEREF: Constant NULL pointer is dereferenced at line 545. : C and C++ 
: minIni.c : Critical (1) : Analyze : Local
545
NPD.CONST.DEREF: Constant NULL pointer is dereferenced at line 558. : C and C++ 
: minIni.c : Critical (1) : Analyze : Local
558
NPD.CONST.DEREF: Constant NULL pointer is dereferenced at line 562. : C and C++ 
: minIni.c : Critical (1) : Analyze : Local
562

RNPD.DEREF: Suspicious dereference of pointer 'ep' before NULL check at line 
213 : C and C++ : minIni.c : Critical (1) : Analyze : Local
203

Dont hesitate to contact me if you need further details

Original issue reported on code.google.com by bayardgr...@gmail.com on 5 Mar 2013 at 2:43

Attachments:

GoogleCodeExporter commented 9 years ago
I think these are false positives.

line 203: "ep" is initialized with "string"; "string" is checked to be non-NULL 
earlier.

line 213/214: if the "string" parameter is non-NULL (which is checked at the 
entry), "ep" cannot be NULL at that point. Line 213 has an assert() for it. 
There is no problem dereferencing the valid pointer at line 214.

lines 520, 545, 558 and 562 all relate to _tcsrchr(). I have no idea why the 
static analysis tool would see this function as a constant NULL pointer.

Original comment by thiadmer...@gmail.com on 5 Mar 2013 at 3:27

GoogleCodeExporter commented 9 years ago
Closed because there are no new indications that these warnings uncover true 
errors.

Original comment by thiadmer...@gmail.com on 28 Mar 2014 at 3:41