summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2011-12-16 18:53:35 +0800
committerDaniel Veillard <veillard@redhat.com>2011-12-16 18:53:35 +0800
commit5bd3c061823a8499b27422aee04ea20aae24f03e (patch)
treee0ec79f58dfd96dd402a65f0e0ad29cb09d7f980 /parser.c
parent77404b8b69bc122d12231807abf1a837d121b551 (diff)
downloadlibxml2-5bd3c061823a8499b27422aee04ea20aae24f03e.tar.gz
Fix an allocation error when copying entities
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 4e5dcb9e..c55e41df 100644
--- a/parser.c
+++ b/parser.c
@@ -2709,7 +2709,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
buffer[nbchars++] = '&';
if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
+ growBuffer(buffer, i + XML_PARSER_BUFFER_SIZE);
}
for (;i > 0;i--)
buffer[nbchars++] = *cur++;