[PyQt] if (sipParseErr == Py_None) Segfault

Phil Thompson phil at riverbankcomputing.com
Thu Jun 10 23:39:37 BST 2010


On Wed, 09 Jun 2010 18:07:37 +0200, Matteo Bertozzi <th30z at develer.com>
wrote:
> 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;

That's not the fix - but it should be fixed in tonight's snapshot.

Thanks,
Phil


More information about the PyQt mailing list