rule_partition.cpp parses rule sources (splitting rules, extracting top-level condition identifiers and facts), but had no fuzz target, contradicting the repository rule that every parser of attacker-influenced input gets one. fuzz_rule_partition asserts the splitter is a total, exact partition of its input, that rule/condition slicing stays within the rule, and that partition selection agrees with magic bytes and the size bucket boundaries. It is registered in fuzz/meson.build (with rule_partition.cpp), swept by scripts/run_fuzzers.sh, and documented next to the other targets. Seeds cover comments, strings, regexes, hex blocks, an include and a truncated source.
12 lines
213 B
Text
12 lines
213 B
Text
import "pe"
|
|
import "math"
|
|
|
|
private rule helper_match {
|
|
strings:
|
|
$a = "MZ"
|
|
$hex = { 4D 5A ?? ?? [0-4] 00 }
|
|
$re = /foo(bar|baz)+/i nocase
|
|
condition:
|
|
$a at 0 or any of them
|
|
}
|
|
|