Commit 2190118b authored by Boxiang Sun's avatar Boxiang Sun

Add argument check for PyDict_Next

In PyDict_Next, the 3rd argument `pkey` and 4th argument pvalue could be
NULL. lxml will try to call it by PyDict_Next(kwdict, &pos, &key, 0).
And a check like CPython did.
parent c7640dc8
......@@ -425,8 +425,10 @@ extern "C" int PyDict_Next(PyObject* op, Py_ssize_t* ppos, PyObject** pkey, PyOb
return 0;
}
*pkey = (*it)->first.value;
*pvalue = (*it)->second;
if (pkey)
*pkey = (*it)->first.value;
if (pvalue)
*pvalue = (*it)->second;
++(*it);
......
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