Project

General

Profile

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)

Added by Philippe Antoine about 1 month ago. Updated 26 days ago.

Status:
Triaged
Priority:
Normal
Assignee:
Target version:
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 Actions #1

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 Actions #2

  • Status changed from New to Triaged
Actions

Also available in: PDF Atom