static analyzer bit for invent.c
src/invent.c(4882): warning: Dereferencing NULL pointer '((otmp))->oextra'.
This commit is contained in:
+3
-1
@@ -4880,7 +4880,9 @@ mergable(
|
|||||||
if ((objnamelth != otmpnamelth
|
if ((objnamelth != otmpnamelth
|
||||||
&& ((objnamelth && otmpnamelth) || obj->otyp == CORPSE))
|
&& ((objnamelth && otmpnamelth) || obj->otyp == CORPSE))
|
||||||
|| (objnamelth && otmpnamelth
|
|| (objnamelth && otmpnamelth
|
||||||
&& strncmp(ONAME(obj), ONAME(otmp), objnamelth)))
|
/* safe_oname could have returned ptr to "", verify before deref */
|
||||||
|
&& has_oname(obj) && has_oname(otmp)
|
||||||
|
&& strncmp(ONAME(obj), ONAME(otmp), objnamelth)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* if one has an attached mail command, other must have same command */
|
/* if one has an attached mail command, other must have same command */
|
||||||
|
|||||||
Reference in New Issue
Block a user