Fixed a buffer overrun (exhibits with very long attributes).

This commit is contained in:
Raph Levien 1999-06-15 21:27:11 +00:00
parent 34e0cc3fe8
commit 05240da818
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Tue Jun 15 14:24:19 1999 Raph Levien <raph@acm.org>
* parser.c: fixed a buffer overrun for when you have a very long
attribute with no entities in it.
Mon Jun 14 00:17:50 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* added example directory

View File

@ -459,6 +459,12 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt, int len, int what,
} else {
/* TODO: invalid for UTF-8 , use COPY(out); */
*out++ = CUR;
if (out - buffer > buffer_size - 100) {
int index = out - buffer;
growBuffer(buffer);
out = &buffer[index];
}
NEXT;
}
}