Commit 5c0aec3f by Victor M. Alvarez

Finally fix #170.

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