diff --git a/libyara/exec.c b/libyara/exec.c index a2dd38d458..f324eb8ed4 100644 --- a/libyara/exec.c +++ b/libyara/exec.c @@ -1967,13 +1967,6 @@ int yr_execute_code(YR_SCAN_CONTEXT* context) ensure_defined(r2); ensure_defined(r1); - if (r1.ss->length == 0) - { - r1.i = false; - push(r1); - break; - } - result = yr_re_exec( context, (uint8_t*) r2.re->code, diff --git a/tests/test-rules.c b/tests/test-rules.c index ad44896bf3..ac00384fbc 100644 --- a/tests/test-rules.c +++ b/tests/test-rules.c @@ -2953,6 +2953,10 @@ static void test_matches_operator() assert_false_rule( "rule test { condition: \"foo\\nbar\" matches /foo.*bar/ }", NULL); + assert_true_rule("rule test { condition: \"\" matches /foo|/ }", NULL); + + assert_true_rule("rule test { condition: \"\" matches /a||b/ }", NULL); + YR_DEBUG_FPRINTF(1, stderr, "} // %s()\n", __FUNCTION__); }