math.percentage returns undefined value when the passed value is outside the 0-255 range.

This commit is contained in:
Victor M. Alvarez
2023-12-28 17:34:23 +01:00
parent c6cc3311ce
commit a1015aa3a9
2 changed files with 40 additions and 2 deletions
+32
View File
@@ -127,6 +127,38 @@ int main(int argc, char** argv)
}",
"ABABCDEF");
assert_true_rule_blob(
"import \"math\" \
rule test { \
condition: \
not defined math.percentage(0x41, 0, 0) \
}",
"AABAAB");
assert_true_rule_blob(
"import \"math\" \
rule test { \
condition: \
not defined math.percentage(0x41, 10, 3) \
}",
"AABAAB");
assert_true_rule_blob(
"import \"math\" \
rule test { \
condition: \
not defined math.percentage(0x41, 0, -3) \
}",
"AABAAB");
assert_true_rule_blob(
"import \"math\" \
rule test { \
condition: \
not defined math.percentage(-1) \
}",
"AABAAB");
assert_true_rule_blob(
"import \"math\" \
rule test { \