]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Fix missing null check
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 28 Nov 2018 15:07:25 +0000 (20:37 +0530)
committerJason Ish <ish@unx.ca>
Tue, 4 Dec 2018 20:14:04 +0000 (14:14 -0600)
Coverity discovered a missing null check for the variable `val`. Fix
 that by adding the appropriate checks for it.

Closes redmine ticket #2676

suricata/update/rule.py

index a400e3f03a199e8dafd32e3da047be3fbe738f79..8474b68014800c4de8d4160735382e952bed513b 100644 (file)
@@ -310,7 +310,7 @@ def parse(buf, group=None):
         elif name == "reference":
             rule.references.append(val)
         elif name == "msg":
-            if val.startswith('"') and val.endswith('"'):
+            if val and val.startswith('"') and val.endswith('"'):
                 val = val[1:-1]
             rule[name] = val
         else: