mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
math.percentage returns undefined value when the passed value is outside the 0-255 range.
This commit is contained in:
@@ -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 { \
|
||||
|
||||
Reference in New Issue
Block a user