Message289967
In file selectmodule.c
our static code scanner has reported the following case, function set2list is liable to return NULL (if PyTuple_New failed), would any chance the NULL pointer be dereferenced (Py_DECREF(fdlist) after set2list) or it would just raise python exception to handle PyTuple_New error ?
static PyObject *
select_select(PyObject *self, PyObject *args)
{
......
if (n < 0) {
PyErr_SetFromErrno(SelectError);
}
#endif
else {
/* any of these three calls can raise an exception. it's more
convenient to test for this after all three calls... but
is that acceptable?
*/
ifdlist = set2list(&ifdset, rfd2obj); // || <=====
ofdlist = set2list(&ofdset, wfd2obj); // ||
efdlist = set2list(&efdset, efd2obj); // ||
if (PyErr_Occurred())
ret = NULL;
else
ret = PyTuple_Pack(3, ifdlist, ofdlist, efdlist);
Py_DECREF(ifdlist);
Py_DECREF(ofdlist);
Py_DECREF(efdlist); |
|
Date |
User |
Action |
Args |
2017-03-22 04:14:16 | alexc | set | recipients:
+ alexc |
2017-03-22 04:14:16 | alexc | set | messageid: <1490156056.24.0.758776369262.issue29874@psf.upfronthosting.co.za> |
2017-03-22 04:14:16 | alexc | link | issue29874 messages |
2017-03-22 04:14:15 | alexc | create | |
|