summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>1999-11-19 14:11:15 +0000
committerThies C. Arntzen <thies@php.net>1999-11-19 14:11:15 +0000
commitb712c9360d66b92fcf7a24a5d1be391eb27495e1 (patch)
tree274d781f959edfea594c7769157d67d3834d72ab
parent1f41ddfe7f224081f461ad703fffbac833c34b22 (diff)
downloadphp-git-b712c9360d66b92fcf7a24a5d1be391eb27495e1.tar.gz
@- Fixed mem-overwrite in XML_Parse_Into_Struct. (Thies)
(PHP xml_parse_into_struct) buffer was sometimes short by 1.
-rw-r--r--ext/xml/xml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index bfcc14b403..4afbf30f3e 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -819,7 +819,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
/* check if the current tag already has a value - if yes append to that! */
if (zend_hash_find((*parser->ctag)->value.ht,"value",sizeof("value"),(void **) &myval) == SUCCESS) {
int newlen = (*myval)->value.str.len + decoded_len;
- (*myval)->value.str.val = erealloc((*myval)->value.str.val,newlen);
+ (*myval)->value.str.val = erealloc((*myval)->value.str.val,newlen+1);
strcpy((*myval)->value.str.val + (*myval)->value.str.len,decoded_value);
(*myval)->value.str.len += decoded_len;
efree(decoded_value);