GNOME Bugzilla – Bug 707750
NULL pointer dereferenced in tree.c
Last modified: 2013-09-11 07:13:42 UTC
Created attachment 254448 [details] [review] Fixing Null pointer dereference. In below code: if (clone->parent != NULL) clone->parent->last = clone; clone = clone->parent; parentClone = clone->parent; after if condition, clone->parent can be NULL. If it is NULL, it is assigned to clone in next statement. So, now clone is NULL after second statement. Third statement, directly dereferences clone, which is NULL after second statement. It may cause crash. Attached patch fixes this issue.
Okay agreed with report and patch though I prefer to fix this in a simpler way: https://git.gnome.org/browse/libxml2/commit/?id=75d13092f2886176fa8e8f354eb8a0e51f7409fd thanks ! Daniel