File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -2291,10 +2291,11 @@ int yr_re_fast_exec(
2291
2291
break ;
2292
2292
2293
2293
case RE_OPCODE_REPEAT_ANY_UNGREEDY :
2294
- if (bytes_matched >= max_bytes_matched )
2294
+ repeat_any_args = (RE_REPEAT_ANY_ARGS * ) (ip + 1 );
2295
+
2296
+ if (bytes_matched + repeat_any_args -> min >= max_bytes_matched )
2295
2297
break ;
2296
2298
2297
- repeat_any_args = (RE_REPEAT_ANY_ARGS * ) (ip + 1 );
2298
2299
match = true;
2299
2300
2300
2301
const uint8_t * next_opcode = ip + 1 + sizeof (RE_REPEAT_ANY_ARGS );
Original file line number Diff line number Diff line change @@ -1601,6 +1601,18 @@ static void test_hex_strings()
1601
1601
condition: $a }" ,
1602
1602
"123440004" );
1603
1603
1604
+ assert_true_rule (
1605
+ "rule test { \
1606
+ strings: $a = { 31[-][8-][-]30 } \
1607
+ condition: $a }" ,
1608
+ "1234567890" );
1609
+
1610
+ assert_false_rule (
1611
+ "rule test { \
1612
+ strings: $a = { 31[-][9-][-]30 } \
1613
+ condition: $a }" ,
1614
+ "1234567890" );
1615
+
1604
1616
assert_error (
1605
1617
"rule test { \
1606
1618
strings: $a = { 01 [0] 02 } \
You can’t perform that action at this time.
0 commit comments