summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2012-04-07 00:23:10 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2012-04-07 00:23:10 +0000
commit6fdd8d6c69c7823c23eac2928a480ea44270dafd (patch)
tree1f8275d3e5023dcd5ca89f65397ef2ee2dd883ae
parent98e480e454b9604a714558bdb7d6a355f2eb1f60 (diff)
downloadlibdom-6fdd8d6c69c7823c23eac2928a480ea44270dafd.tar.gz
libdom-6fdd8d6c69c7823c23eac2928a480ea44270dafd.tar.bz2
Fix a crash on http://gopher.floodgap.com/overbite/
_dom_element_attr_list_node_clone() forgot to init the list entry. Added some asserts. svn path=/trunk/libdom/; revision=13811
-rw-r--r--src/core/element.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/element.c b/src/core/element.c
index a792ae5..8908968 100644
--- a/src/core/element.c
+++ b/src/core/element.c
@@ -182,6 +182,8 @@ static void _dom_element_attr_list_node_unlink(dom_attr_list *n)
static void _dom_element_attr_list_insert(dom_attr_list *list,
dom_attr_list *new_attr)
{
+ assert(list != NULL);
+ assert(new_attr != NULL);
list_append(&list->list, &new_attr->list);
}
@@ -213,6 +215,7 @@ static dom_attr_list * _dom_element_attr_list_find_by_name(
}
attr = _dom_element_attr_list_next(attr);
+ assert(attr != NULL);
} while (attr != list);
return NULL;
@@ -398,6 +401,8 @@ static dom_attr_list * _dom_element_attr_list_node_clone(dom_attr_list *n)
if (new_list_node == NULL)
return NULL;
+ list_init(&new_list_node->list);
+
new_list_node->name = NULL;
new_list_node->namespace = NULL;