From: "Erich E. Hoover" Subject: [PATCH 1/1] hhctrl.ocx: Keep parsing failure from causing a segmentation fault. Message-Id: Date: Mon, 25 Jun 2012 12:31:29 -0600 The attached patch is intended to fix Bug #30948, where an HTML Help index contains invalid entries in that the list item does not have a proper closing "".  So, this patch fixes a segfault that occurs when parsing indices that are of the form: ---
  • ...
  • ...
  • --- From 8addf002d03224013cacaad1f0c12ef027f93a3d Mon Sep 17 00:00:00 2001 From: Erich Hoover Date: Mon, 25 Jun 2012 08:54:47 -0600 Subject: hhctrl.ocx: Keep parsing failure from causing a segmentation fault. --- dlls/hhctrl.ocx/index.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/hhctrl.ocx/index.c b/dlls/hhctrl.ocx/index.c index 3cf69de..2cc79a6 100644 --- a/dlls/hhctrl.ocx/index.c +++ b/dlls/hhctrl.ocx/index.c @@ -191,6 +191,8 @@ static IndexItem *parse_li(HHInfo *info, stream_t *stream) strbuf_zero(&node); } + if(!ret) + FIXME("Failed to parse
  • tag!\n"); strbuf_free(&node); strbuf_free(&node_name); @@ -227,9 +229,11 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item) if(!strcasecmp(node_name.buf, "li")) { item->next = parse_li(info, &stream); - item->next->merge = item->merge; - item = item->next; - item->indentLevel = indent_level; + if(item->next) { + item->next->merge = item->merge; + item = item->next; + item->indentLevel = indent_level; + } }else if(!strcasecmp(node_name.buf, "ul")) { indent_level++; }else if(!strcasecmp(node_name.buf, "/ul")) { -- 1.7.5.4