Skip to content

Commit

Permalink
Fix null pointer dereference issue detected by coverity
Browse files Browse the repository at this point in the history
Coverity scan of the current code raised the following issue:
```
>>>     CID 327298:  Null pointer dereferences  (FORWARD_NULL)
>>>     Accessing a property of null-like value "val".
271                 if val.find("noalert") > -1:
```

Fix this by adding a null check on val.

Closes redmine ticket #2834.
  • Loading branch information
inashivb committed Mar 26, 2019
1 parent 8749328 commit 3e07963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion suricata/update/rule.py
Expand Up @@ -268,7 +268,7 @@ def parse(buf, group=None):
rule[name] += [v.strip() for v in val.split(",")]
elif name == "flowbits":
rule.flowbits.append(val)
if val.find("noalert") > -1:
if val and val.find("noalert") > -1:
rule["noalert"] = True
elif name == "reference":
rule.references.append(val)
Expand Down

0 comments on commit 3e07963

Please sign in to comment.