summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2009-09-25 22:17:31 +0200
committerMike Hommey <glandium@debian.org>2009-09-25 22:17:31 +0200
commit67a17fecb5b5fe2058af6405bc9601875f3e75a1 (patch)
tree73a7ed49173098b5c59eeb8a33747d3b803d2309 /parser.c
parentc3e4f3c26035bc93a69e5aa2ad435809e8be8a4e (diff)
downloadlibxml2-67a17fecb5b5fe2058af6405bc9601875f3e75a1.tar.gz
Import upstream version 2.7.5upstream/2.7.5.dfsg
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index e415339..b41dcc3 100644
--- a/parser.c
+++ b/parser.c
@@ -10130,8 +10130,12 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
/*
* Check for the XMLDecl in the Prolog.
* do not GROW here to avoid the detected encoder to decode more
- * than just the first line
+ * than just the first line, unless the amount of data is really
+ * too small to hold "<?xml version="1.0" encoding="foo"
*/
+ if ((ctxt->input->end - ctxt->input->cur) < 35) {
+ GROW;
+ }
if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
/*