GNOME Bugzilla – Bug 719540
Clang static analysis fixes
Last modified: 2013-12-04 14:04:09 UTC
A couple of patches fixing some bugs where a NULL pointer is potentially used when an object was expected (e.g. resulting in g_object_[un]ref(NULL)). These were found by scan-build (http://www.murrayc.com/permalink/2013/11/15/jhbuild-and-clangs-scan-build/) with some GLib patches to mark functions as not accepting NULL arguments (bug #113075).
Created attachment 263101 [details] [review] pine-importer: Fix a crash when importing with no existing address books This is a theoretical crash (not actually reproduced), caused by the client variable being NULL if no address books exist. Instead of crashing, gracefully exit with an error. Found by scan-build.
Created attachment 263102 [details] [review] icalendar-importer: Fix a crash when importing with no existing cals This is a theoretical crash (not actually reproduced) caused by calling g_object_ref(source) when source is NULL, which can happen if no calendars or task lists exist. This fixes the crash, but there may be UI bugs if this condition is reached. Found by scan-build.
Thanks! The built-in sources supplied by EDS ("system-addressbook", et. al.) should ensure these cases are never hit, but good to code defensively anyway. Fixed for Evolution 3.11.3: https://git.gnome.org/browse/evolution/commit/?id=7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f https://git.gnome.org/browse/evolution/commit/?id=d6e2d993bba77ad5965961c534ffe73cae39511a and Evolution 3.10.3: https://git.gnome.org/browse/evolution/commit/?h=gnome-3-10&id=6a576d7441f64c08df0b144346d844ea46364a52 https://git.gnome.org/browse/evolution/commit/?h=gnome-3-10&id=638dff3e3e04ed112595e775407f35f59b1c04a3