Actions
Optimization #8673
open
PA
OD
detect/firewall: DoParseAppPolicy has logical dead code if (hookname == NULL)
Optimization #8673:
detect/firewall: DoParseAppPolicy has logical dead code if (hookname == NULL)
Effort:
Difficulty:
Label:
Description
From coverity CID 1694489
The second
if (hookname == NULL)
return 0;
is dead code because we had previously already the same
if (hookname == NULL)
return 0;
that would have returned from the function.
Can we just remove the dead code ? Or should we not return in the first place as there is still some work to do ?
JF Updated by Juliana Fajardini Reichow 26 days ago
The first check seems needed to avoid having a crash when defining the policy_name (which uses nname, duplicated from hookname).
policy_name is used when calling DoParsePolicy.
So to me it looks indeed like the second one is dead code and could be removed (but not the first).
PA Updated by Philippe Antoine 26 days ago
- Status changed from New to Triaged
Actions