diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2012-09-28 08:27:32 +0100 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2012-09-28 08:27:32 +0100 |
commit | ae8a3ede3e1e4d139f8e564cf393c1ab8914cd44 (patch) | |
tree | cb1efba40baf9ce908ba2b6efe4df923e60b3498 | |
parent | 718237c2a502817536bc206344cefcd699fd4fd3 (diff) | |
download | netsurf-ae8a3ede3e1e4d139f8e564cf393c1ab8914cd44.tar.gz netsurf-ae8a3ede3e1e4d139f8e564cf393c1ab8914cd44.tar.bz2 |
Fix bug #3572539: handle empty option elements.
-rw-r--r-- | render/box_construct.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index 5b22e9990..37fdede93 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -2867,9 +2867,12 @@ bool box_select_add_option(struct form_control *control, dom_node *n) if (err != DOM_NO_ERR) return false; - text = squash_whitespace(dom_string_data(content)); - - dom_string_unref(content); + if (content != NULL) { + text = squash_whitespace(dom_string_data(content)); + dom_string_unref(content); + } else { + text = strdup(""); + } if (text == NULL) goto no_memory; |