File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -804,11 +804,13 @@ int yara_callback(
804
804
return CALLBACK_CONTINUE ;
805
805
806
806
case CALLBACK_MSG_RULE_NOT_MATCHING :
807
- // If the rule doesn't match and the user has not specified that they want
808
- // to see non-matches then there's nothing more to do and we return
809
- // CALLBACK_CONTINUE, keep executing the function if otherwise.
807
+ // In cases where the rule doesn't match and the user didn't provided a
808
+ // callback function or is not interested in getting notified about
809
+ // non-matches, there's nothing more do to here, keep executing the function
810
+ // if otherwise.
810
811
811
- if ((which & CALLBACK_NON_MATCHES ) != CALLBACK_NON_MATCHES )
812
+ if (callback == NULL ||
813
+ (which & CALLBACK_NON_MATCHES ) != CALLBACK_NON_MATCHES )
812
814
return CALLBACK_CONTINUE ;
813
815
}
814
816
@@ -1616,6 +1618,7 @@ static PyObject* Rules_match(
1616
1618
callback_data .matches = PyList_New (0 );
1617
1619
1618
1620
Py_BEGIN_ALLOW_THREADS
1621
+
1619
1622
error = yr_rules_scan_file (
1620
1623
object -> rules ,
1621
1624
filepath ,
@@ -1624,7 +1627,6 @@ static PyObject* Rules_match(
1624
1627
& callback_data ,
1625
1628
timeout );
1626
1629
1627
-
1628
1630
Py_END_ALLOW_THREADS
1629
1631
}
1630
1632
else if (data .buf != NULL )
You can’t perform that action at this time.
0 commit comments