GNOME Bugzilla – Bug 334116
NULL deref in mpr-old-xml.c reported by the coverity checker
Last modified: 2009-04-07 18:22:56 UTC
Event returned_null: Function "old_xml_search_child" returned NULL value (checked 8 out of 9 times) [model] Event var_assigned: Variable "child" assigned to NULL return value from "old_xml_search_child" Also see events: [var_assigned][dereference] 1006 child = old_xml_search_child (calendars, "day-types"); 1007 1008 /* Insert hardcoded days. */ 1009 g_hash_table_insert (parser->day_hash, 1010 GINT_TO_POINTER (MRP_DAY_WORK), 1011 mrp_day_ref (mrp_day_get_work ())); 1012 g_hash_table_insert (parser->day_hash, 1013 GINT_TO_POINTER (MRP_DAY_NONWORK), 1014 mrp_day_ref (mrp_day_get_nonwork ())); 1015 g_hash_table_insert (parser->day_hash, 1016 GINT_TO_POINTER (MRP_DAY_USE_BASE), 1017 mrp_day_ref (mrp_day_get_use_base ())); 1018 1019 /* Read day-types */ Event dereference: Dereferencing NULL value "child" Also see events: [returned_null][var_assigned] 1020 for (day = child->children; day; day = day->next) { 1021 old_xml_read_day_type (parser, day); 1022 }
Yup child can be NULL and there were other cases where cild wa checked but not this particular section so added in the check != NULL. Patch attched (same as for 334113, 334114, 334116 , 334117, 334121).
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.