The attached clang5_static_analyzer_results.txt contains the output from the Apple Clang 5.0 static analyzer for pymol svn at r4042 with the proposed patch from https://sourceforge.net/p/pymol/patches/6/ applied. The instances which indicate garbage values should be looked at first. The dereference of a null pointer instances will require close examination as the static analyzer doesn't recognize conditionals for null pointers (so these have to be looked at individually...see http://clang-analyzer.llvm.org/faq.html#null_pointer).
At least some of these detections of null pointer dereferences appear to be actual coding errors. For instance in layer0/Isosurf.c....
does indeed appear to allow result to be assigned a NULL pointer and then dereferenced for the assignment of NULL to result->gradients.
Also note the warnings issued for...
which caused me to notice that we have...
int a, l;
and
in PConvPyListToFloatArray. After python 2.5, this isn't correct as...
Py_ssize_t PyList_Size(PyObject *list)
Return the length of the list object in list; this is equivalent to len(list) on a list object.
Changed in version 2.5: This function returned an int. This might require changes in your code for properly supporting 64-bit systems.
Another one worth looking at is...
where earlier in that code you actually test if render_height is zero at...
but not later for the division.