Skip to content

Commit

Permalink
Heap-based buffer overread in xmlNextChar
Browse files Browse the repository at this point in the history
For https://bugzilla.gnome.org/show_bug.cgi?id=759671

when the end of the internal subset isn't properly detected
xmlParseInternalSubset should just return instead of trying
to process input further.
  • Loading branch information
veillard committed Feb 9, 2016
1 parent 6657afe commit a7a9461
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -8468,6 +8468,7 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
*/
if (RAW != '>') {
xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
return;
}
NEXT;
}
Expand Down
10 changes: 5 additions & 5 deletions result/errors/754946.xml.err
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Entity: line 1: parser error : DOCTYPE improperly terminated
Entity: line 1:
A<lbbbbbbbbbbbbbbbbbbb_
^
./test/errors/754946.xml:1: parser error : Start tag doesn't start and stop in the same entity
>%SYSTEM;<![
^
./test/errors/754946.xml:1: parser error : Extra content at the end of the document
>%SYSTEM;<![
Entity: line 1: parser error : Start tag expected, '<' not found
%SYSTEM;
^
Entity: line 1:
A<lbbbbbbbbbbbbbbbbbbb_
^
2 changes: 1 addition & 1 deletion result/errors/content1.xml.err
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
^
./test/errors/content1.xml:7: parser error : Start tag expected, '<' not found
<!ELEMENT aElement (a |b * >
^
^
2 changes: 1 addition & 1 deletion result/valid/t8.xml.err
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Entity: line 1: parser error : Start tag expected, '<' not found
^
Entity: line 1:
&lt;!ELEMENT root (middle) >
^
^
2 changes: 1 addition & 1 deletion result/valid/t8a.xml.err
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Entity: line 1: parser error : Start tag expected, '<' not found
^
Entity: line 1:
&lt;!ELEMENT root (middle) >
^
^

0 comments on commit a7a9461

Please sign in to comment.