lynx/lynx-crash.patch
2008-08-07 18:03:24 +00:00

36 lines
1022 B
Diff

diff -up lynx2-8-6/src/HTML.c.crash lynx2-8-6/src/HTML.c
--- lynx2-8-6/src/HTML.c.crash 2005-12-18 17:52:30.000000000 -0500
+++ lynx2-8-6/src/HTML.c 2008-08-07 14:00:57.000000000 -0400
@@ -6992,7 +6992,7 @@ static int HTML_end_element(HTStructured
case HTML_SELECT:
{
- char *ptr;
+ char *ptr = NULL;
/*
* Make sure we had a select start tag.
@@ -7032,13 +7032,15 @@ static int HTML_end_element(HTStructured
/*
* Finish the previous option.
*/
- ptr = HText_setLastOptionValue(me->text,
- me->option.data,
- me->LastOptionValue,
- LAST_ORDER,
- me->LastOptionChecked,
- me->UCLYhndl,
- ATTR_CS_IN);
+ if (!me->first_option)
+ ptr = HText_setLastOptionValue(me->text,
+ me->option.data,
+ me->LastOptionValue,
+ LAST_ORDER,
+ me->LastOptionChecked,
+ me->UCLYhndl,
+ ATTR_CS_IN);
+
FREE(me->LastOptionValue);
me->LastOptionChecked = FALSE;