pythonqt icon indicating copy to clipboard operation
pythonqt copied to clipboard

Potential null pointer dereference in PythonQtConvertListOfKnownClassToPythonList

Open samoptibrium opened this issue 3 years ago • 1 comments

https://github.com/MeVisLab/pythonqt/blob/58ccd5393922d88fd320628aa2db787df1f1233b/src/PythonQtConversion.h#L272-L275

https://github.com/MeVisLab/pythonqt/blob/58ccd5393922d88fd320628aa2db787df1f1233b/src/PythonQtConversion.h#L292-L295

This code checks the "innerType" pointer for null and then, if null, is dereferencing the pointer in the cerr prints.

samoptibrium avatar Nov 02 '21 12:11 samoptibrium

Indeed, QMetaType::typeName(metaTypeId) should be used instead of innerType->className().constData(), like in the methods above. I guess this never was a problem because these methods really are only used with known classes.

usiems avatar Nov 02 '21 13:11 usiems