summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2009-08-02 15:45:51 +0000
committercorvid <corvid@lavabit.com>2009-08-02 15:45:51 +0000
commit4760495cae7967364a97f9d59b73454ab03ee772 (patch)
treeab7ab65cf07f4a95988d6116682092646a4a8e04
parent6b86ff84a0c8255525d0984cab43519a99395e3b (diff)
fix segfault in Html_parse_doctype
BUG 918. http://www.freiesmagazin.de/mobil/freiesMagazin-2009-08-bilder.html contained <!DOCTYPE HTML PUBLIC //W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> so the last character in the tag was an open quote.
-rw-r--r--ChangeLog1
-rw-r--r--src/html.cc2
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ea9017fa..f6a155b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@ dillo-2.2 [??]
- Fix cache segfault when cache entry removed.
- Split words that contain whitespace as numeric character references.
- Allow linebreaks around Chinese/Japanese characters.
+ - Fix segfault in Html_parse_doctype (BUG#918).
Patches: corvid
-----------------------------------------------------------------------------
diff --git a/src/html.cc b/src/html.cc
index a8b15c61..a8412f43 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -1498,7 +1498,7 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
if (isspace(*p)) {
for (ntag[i++] = ' '; isspace(p[1]); ++p) ;
} else if ((quote = *p) == '"' || *p == '\'') {
- for (ntag[i++] = *p++; (ntag[i++] = *p) && *p != quote; ++p) {
+ for (ntag[i++] = *p++; (ntag[i] = *p) && ntag[i++] != quote; ++p) {
if (*p == '\n' || *p == '\r')
ntag[i - 1] = ' ';
p += (p[0] == '\r' && p[1] == '\n') ? 1 : 0;