After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334116 - NULL deref in mpr-old-xml.c reported by the coverity checker
NULL deref in mpr-old-xml.c reported by the coverity checker
Status: RESOLVED FIXED
Product: planner
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: planner-maint
planner-maint
Depends on:
Blocks:
 
 
Reported: 2006-03-10 11:20 UTC by Kjartan Maraas
Modified: 2009-04-07 18:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kjartan Maraas 2006-03-10 11:20:08 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 			}
Comment 1 Lincoln Phipps 2006-07-18 00:34:23 UTC
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). 
Comment 2 Maurice van der Pot 2009-04-07 18:22:56 UTC
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.