summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-12-27 16:36:05 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2013-12-27 16:36:05 (GMT)
commit44d4e3255c5a2e6c6517c06e8eb3e88eaa20d657 (patch)
treeb75bf82f1c83512eac0611121cde87f6c4953552
parent45b5b023f34da5398b26968af851acb0ee4c5b2b (diff)
downloadlibdom-44d4e3255c5a2e6c6517c06e8eb3e88eaa20d657.tar.gz
libdom-44d4e3255c5a2e6c6517c06e8eb3e88eaa20d657.tar.bz2
Prevent attempt to concatinate string with null.
-rw-r--r--src/core/text.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/text.c b/src/core/text.c
index e36050e..3b726fd 100644
--- a/src/core/text.c
+++ b/src/core/text.c
@@ -491,14 +491,18 @@ dom_exception walk_logic_adjacent_text(dom_text *text,
return err;
}
- err = dom_string_concat(*ret, data, &tmp);
- dom_string_unref(data);
- dom_string_unref(*ret);
- if (err != DOM_NO_ERR) {
- return err;
- }
+ if (*ret != NULL) {
+ err = dom_string_concat(*ret, data, &tmp);
+ dom_string_unref(data);
+ dom_string_unref(*ret);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
- *ret = tmp;
+ *ret = tmp;
+ } else {
+ *ret = data;
+ }
} else {
dom_node_internal *tn;
err = dom_node_remove_child(node->parent, node,