mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-29 21:46:59 +03:00
Make sure to grow input buffer in xmlParseMisc
Otherwise, large amount of whitespace could lead to documents not being parsed correctly. Fixes #299.
This commit is contained in:
parent
9b8ef34dc9
commit
9653565765
15
parser.c
15
parser.c
@ -10659,16 +10659,16 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
void
|
||||
xmlParseMisc(xmlParserCtxtPtr ctxt) {
|
||||
while ((ctxt->instate != XML_PARSER_EOF) &&
|
||||
(((RAW == '<') && (NXT(1) == '?')) ||
|
||||
(CMP4(CUR_PTR, '<', '!', '-', '-')) ||
|
||||
IS_BLANK_CH(CUR))) {
|
||||
while (ctxt->instate != XML_PARSER_EOF) {
|
||||
SKIP_BLANKS;
|
||||
GROW;
|
||||
if ((RAW == '<') && (NXT(1) == '?')) {
|
||||
xmlParsePI(ctxt);
|
||||
} else if (IS_BLANK_CH(CUR)) {
|
||||
NEXT;
|
||||
} else
|
||||
} else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
|
||||
xmlParseComment(ctxt);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10774,7 +10774,6 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
||||
/*
|
||||
* The Misc part of the Prolog
|
||||
*/
|
||||
GROW;
|
||||
xmlParseMisc(ctxt);
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user