Skip to content

Commit

Permalink
Allowing the full range of PIDs to be passed to match (including 0).
Browse files Browse the repository at this point in the history
  • Loading branch information
grrrrrrrrr committed Sep 28, 2017
1 parent 7625f31 commit e65477d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yara-python.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ static PyObject* Rules_match(
char* filepath = NULL;
char* data = NULL;

int pid = 0;
unsigned int pid = UINT_MAX;
int timeout = 0;
int length;
int error = ERROR_SUCCESS;
Expand All @@ -1358,7 +1358,7 @@ static PyObject* Rules_match(
if (PyArg_ParseTupleAndKeywords(
args,
keywords,
"|sis#OOOiOO",
"|sIs#OOOiOO",
kwlist,
&filepath,
&pid,
Expand All @@ -1371,7 +1371,7 @@ static PyObject* Rules_match(
&callback_data.modules_data,
&callback_data.modules_callback))
{
if (filepath == NULL && data == NULL && pid == 0)
if (filepath == NULL && data == NULL && pid == UINT_MAX)
{
return PyErr_Format(
PyExc_TypeError,
Expand Down Expand Up @@ -1465,7 +1465,7 @@ static PyObject* Rules_match(

Py_END_ALLOW_THREADS
}
else if (pid != 0)
else if (pid != UINT_MAX)
{
callback_data.matches = PyList_New(0);

Expand Down

0 comments on commit e65477d

Please sign in to comment.