From ae8a3ede3e1e4d139f8e564cf393c1ab8914cd44 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Fri, 28 Sep 2012 08:27:32 +0100 Subject: Fix bug #3572539: handle empty option elements. --- render/box_construct.c | 9 ++++++--- 1 file 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; -- cgit v1.2.3