summaryrefslogtreecommitdiff
path: root/tests/analysis/scan
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-24 22:30:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-24 22:30:12 (GMT)
commit4eebf4a8752464691053fa3706ea6be9413676fa (patch)
tree40dc0f44835629729ca7fbf6858789b67825e72d /tests/analysis/scan
parentaae46fab1f41df0cce9da9fc3c17eea776e487b1 (diff)
Ensure patterns found at the edges of scanned content do not crash the scanner.
Diffstat (limited to 'tests/analysis/scan')
-rw-r--r--tests/analysis/scan/fuzzing.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/analysis/scan/fuzzing.py b/tests/analysis/scan/fuzzing.py
index e26c496..5d99c35 100644
--- a/tests/analysis/scan/fuzzing.py
+++ b/tests/analysis/scan/fuzzing.py
@@ -192,3 +192,23 @@ rule test {
''' % ("0" * (256 * 2 + 8), "0" * (256 * 2 + 8))
self.check_rule_success(rule)
+
+
+ def testFileFinalAccess(self):
+ """Ensure patterns found at the edges of scanned content do not crash the scanner."""
+
+ cnt = MemoryContent(bytes([ 0 for i in range(16) ]))
+
+ rule = '''
+rule test {
+
+ bytes:
+ $a = { 00 00 00 00 00 00 00 00 }
+
+ condition:
+ $a
+
+}
+'''
+
+ self.check_rule_success(rule, cnt)