1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

Fix an allocation error when copying entities

This commit is contained in:
Daniel Veillard
2011-12-16 18:53:35 +08:00
parent 77404b8b69
commit 5bd3c06182

View File

@@ -2709,7 +2709,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
buffer[nbchars++] = '&'; buffer[nbchars++] = '&';
if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) { 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--) for (;i > 0;i--)
buffer[nbchars++] = *cur++; buffer[nbchars++] = *cur++;