]> git.ipfire.org Git - people/ms/suricata.git/commit
detect: fix bug where rule without sid is accepted
authorJuliana Fajardini <jufajardini@gmail.com>
Thu, 17 Jun 2021 16:18:09 +0000 (17:18 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 1 Jul 2021 06:20:48 +0000 (08:20 +0200)
commita15fada7271d125ed3b4d9f29d72ff10ff652ff5
tree4bf838cd9ee4438cdfcb275c67d0232affdb04b8
parent0eefd90a9369f1ab6a86472d9be64693386b95b7
detect: fix bug where rule without sid is accepted

Before, if Suricata parsed a rule without a 'sid' option, instead of
failing that rule, the rule was parsed and attributed a sid 0.
Changes to:
detect-parse:
- add logic to filter out rules without sid;
- change unittest which didn't have a sid, but used to pass.
detect-sid: add unittest for rules without sid or with sid: 0
src/detect-parse.c
src/detect-sid.c