Errors seen in LOGS/libewf-20100226-4.fc17

This is a summary of errors seen when compiling with an experimental static analysis tool

Raw build logs can be seen here

Reference count too low

Code paths in which the reference count of an object is left too low. This could lead to the object being deallocated too early, triggering segfaults when later accessed. Over repeated calls, these errors could accumulate, increasing the likelihood of a segfault.

pyewf_file.c pyewf_file_seek_offset ob_refcnt of return value is 1 too low
pyewf_file.c pyewf_file_get_header_value ob_refcnt of return value is 1 too low
pyewf_file.c pyewf_file_close ob_refcnt of return value is 1 too low

Reference leaks

Code paths in which the reference count of an object is left too high, leading to memory leaks

pyewf_file.c pyewf_file_read ob_refcnt of '*result_data' is 1 too high
pyewf_file.c pyewf_file_get_header_values ob_refcnt of '*dictionary_object' is 1 too high
pyewf.c pyewf_open ob_refcnt of '*file_arguments' is 1 too high

Segfaults within error-handling paths

Code paths in error-handling that will lead to a segmentatation fault (e.g. under low memory conditions)

pyewf_file.c pyewf_file_read calling PyString_AsString with NULL as argument 1 (result_data) at pyewf_file.c:377
pyewf_file.c pyewf_file_get_header_values calling PyDict_SetItemString with NULL as argument 3 (string_object) at pyewf_file.c:829
pyewf.c pyewf_open dereferencing NULL (MEM[(struct PyObject *)pyewf_file].ob_refcnt) at pyewf.c:228
pyewf.c initpyewf calling PyModule_AddObject with NULL as argument 1 (module) at pyewf.c:284

Returning (PyObject*)NULL without setting an exception

These messages are often false-positives: the analysis tool has no knowledge about internal API calls that can lead to an exception being set
pyewf.c pyewf_open returning (PyObject*)NULL without setting an exception

Implementation notes for gcc-with-cpychecker

The following "Py" functions were used but aren't yet explicitly handled by gcc-with-cpychecker