Skip to content

Commit

Permalink
Fix incorrect types passed to PyArg_ParseTupleAndKeywords
Browse files Browse the repository at this point in the history
For a similar reason as `Py_BuildValue`, telling Python to use a smaller
sized value than actually passed may cause strange values to end up in
the result.
  • Loading branch information
QuLogic committed Oct 19, 2024
1 parent cb21a80 commit 00182cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Automaton.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ automaton_iter(PyObject* self, PyObject* args, PyObject* keywds) {
return NULL;
}

if (!F(PyArg_ParseTupleAndKeywords)(args, keywds, "O|iii", kwlist, &object, &start_tmp, &end_tmp, &ignore_white_space_tmp)) {
if (!F(PyArg_ParseTupleAndKeywords)(args, keywds, "O|nni", kwlist, &object, &start_tmp, &end_tmp, &ignore_white_space_tmp)) {
return NULL;
}

Expand Down

0 comments on commit 00182cd

Please sign in to comment.