diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-10-30 16:02:08 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-11-05 15:56:28 +0100 |
commit | a7ea508d281352b1fae056b5c8e86648063b2629 (patch) | |
tree | 9430694100cac4cde522d45ff2eef1082139b9ee | |
parent | d6b312aa86bb78faeb0bf430464a494d1113a62c (diff) | |
download | mupdf-a7ea508d281352b1fae056b5c8e86648063b2629.tar.xz |
Ignore <!DOCTYPE ...> declaration in XML parser.
-rw-r--r-- | source/fitz/xml.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/fitz/xml.c b/source/fitz/xml.c index 958eb51c..be233185 100644 --- a/source/fitz/xml.c +++ b/source/fitz/xml.c @@ -288,6 +288,7 @@ parse_element: parse_comment: if (*p == '[') goto parse_cdata; + if (*p == 'D' && !memcmp(p, "DOCTYPE", 7)) goto parse_declaration; if (*p++ != '-') return "syntax error in comment (<! not followed by --)"; if (*p++ != '-') return "syntax error in comment (<!- not followed by -)"; /* mark = p; */ @@ -300,6 +301,10 @@ parse_comment: } return "end of data in comment"; +parse_declaration: + while (*p) if (*p++ == '>') goto parse_text; + return "end of data in declaration"; + parse_cdata: if (p[1] != 'C' || p[2] != 'D' || p[3] != 'A' || p[4] != 'T' || p[5] != 'A' || p[6] != '[') return "syntax error in CDATA section"; |