[PyQt] if (sipParseErr == Py_None) Segfault

Matteo Bertozzi th30z at develer.com
Wed Jun 9 17:07:37 BST 2010


 I've a segfault for a non return.

sipParseErr is NULL but is checked agains Py_None which is different
from NULL.

> PyObject *sipParseErr = NULL;
> 
> ...
> 
> Py_XDECREF(sipParseErr);
> 
> if (sipParseErr == Py_None)
>     return NULL;
> 
> /* Raise an exception if the arguments couldn't be parsed. */
> sipNoMethod(sipParseErr, sipName_TestSipErr, sipName___getitem__, NULL);

A simple solution is to check for (sipParseErr == NULL || sipParseErr == Py_None).
Or set PyObject *sipParseErr = Py_None;

-- 
Matteo Bertozzi - th30z at develer.com
Develer S.r.l. - http://www.develer.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sip-null-pynone.tar.bz2
Type: application/x-bzip-compressed-tar
Size: 5302 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100609/e1ea599f/attachment.bin>


More information about the PyQt mailing list