From: Mike Blumenkrantz Date: Mon, 4 Jul 2011 03:50:37 +0000 (+0000) Subject: fix some segvs in eet_node X-Git-Tag: submit/efl/20131015.063327~9033 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=015a2ca20842dd2689c3a932668c8a7114a21a54;p=platform%2Fupstream%2Fefl.git fix some segvs in eet_node SVN revision: 60958 --- diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog index ce5520cf0b..76850145ec 100644 --- a/legacy/eet/ChangeLog +++ b/legacy/eet/ChangeLog @@ -515,3 +515,4 @@ * Add functions to manipulate nodes: eet_node_children_get, eet_node_next_get, eet_node_parent_get, eet_node_type_get, eet_node_value_get, eet_node_name_get + * Fix segmentation faults in several eet_node functions diff --git a/legacy/eet/src/lib/eet_node.c b/legacy/eet/src/lib/eet_node.c index 771fe13186..12bb0e6e41 100644 --- a/legacy/eet/src/lib/eet_node.c +++ b/legacy/eet/src/lib/eet_node.c @@ -213,6 +213,8 @@ eet_node_struct_child_new(const char *parent, { Eet_Node *n; + if (!child) return NULL; + if (child->type != EET_G_UNKNOWN) return child; @@ -254,6 +256,7 @@ eet_node_list_append(Eet_Node *parent, const char *tmp; Eet_Node *nn; + if ((!parent) || (!child)) return; tmp = eina_stringshare_add(name); for (nn = parent->values; nn; nn = nn->next) @@ -296,6 +299,7 @@ eet_node_struct_append(Eet_Node *parent, Eet_Node *prev; Eet_Node *nn; + if ((!parent) || (!child)) return; if (parent->type != EET_G_UNKNOWN) { ERR("[%s] is not a structure. Will not insert [%s] in it", @@ -343,6 +347,8 @@ eet_node_hash_add(Eet_Node *parent, { Eet_Node *nn; + if ((!parent) || (!child)) return; + /* No list found, so create it. */ nn = eet_node_hash_new(name, key, child);