Commit 5c0aec3f by Victor M. Alvarez

Finally fix #170.

The previous commit was still wrong.
parent 8b7890b4
......@@ -804,11 +804,13 @@ int yara_callback(
return CALLBACK_CONTINUE;
case CALLBACK_MSG_RULE_NOT_MATCHING:
// If the rule doesn't match and the user has not specified that they want
// to see non-matches then there's nothing more to do and we return
// CALLBACK_CONTINUE, keep executing the function if otherwise.
// In cases where the rule doesn't match and the user didn't provided a
// callback function or is not interested in getting notified about
// non-matches, there's nothing more do to here, keep executing the function
// if otherwise.
if ((which & CALLBACK_NON_MATCHES) != CALLBACK_NON_MATCHES)
if (callback == NULL ||
(which & CALLBACK_NON_MATCHES) != CALLBACK_NON_MATCHES)
return CALLBACK_CONTINUE;
}
......@@ -1616,6 +1618,7 @@ static PyObject* Rules_match(
callback_data.matches = PyList_New(0);
Py_BEGIN_ALLOW_THREADS
error = yr_rules_scan_file(
object->rules,
filepath,
......@@ -1624,7 +1627,6 @@ static PyObject* Rules_match(
&callback_data,
timeout);
Py_END_ALLOW_THREADS
}
else if (data.buf != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment