]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect/asn1: Fix relative_offset keyword option
authorEmmanuel Thompson <eet6646@gmail.com>
Tue, 28 Apr 2020 18:03:26 +0000 (14:03 -0400)
committerVictor Julien <victor@inliniac.net>
Sat, 6 Jun 2020 12:34:51 +0000 (14:34 +0200)
commitbe3379f00e30fd4776c6a3a622c2b27ca60a92e1
treeda5b384dfc90ededdb2f34c37482bc114be2d520
parentf5e2968f129737ccbd5f0ee8ae3776203714b229
detect/asn1: Fix relative_offset keyword option

- Fix relative_offset keyword option to be relative in regards to the
last content match
- Change relative_offset to int32_t with bounds check to allow the full
range of the packet buffer size (uint16_t)
- Added checks for over/underflows
- Changed the offset type to uint16_t because the offset is applied to
the payload length, which is a uint16_t
- Adjusted test cases to work relative to the content match
- Added test case to verify bounds
src/detect-asn1.c
src/detect-asn1.h