summaryrefslogtreecommitdiff
path: root/ext/wddx
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-03-04 02:23:47 (GMT)
committerStanislav Malyshev <stas@php.net>2007-03-04 02:23:47 (GMT)
commitb2673ab004b63c4454847e5a0f22ff8dbdcef6f8 (patch)
tree7385e59bfd6e8f9d93af0d4ac02eec3e75be5f2b /ext/wddx
parent730a77f19b2fe572e6685c0cfba4074b3a2d5fa8 (diff)
downloadphp-b2673ab004b63c4454847e5a0f22ff8dbdcef6f8.tar.gz
fix wrong code
# noticed by Stefan Esser
Diffstat (limited to 'ext/wddx')
-rw-r--r--ext/wddx/wddx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index a250e20..471ba1a 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -1034,9 +1034,9 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
Z_STRVAL_P(ent->data) = estrndup(decoded, decoded_len);
Z_STRLEN_P(ent->data) = decoded_len;
} else {
+ Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + decoded_len + 1);
+ strlcpy(Z_STRVAL_P(ent->data) + Z_STRLEN_P(ent->data), decoded, decoded_len);
Z_STRLEN_P(ent->data) += decoded_len;
- Z_STRVAL_P(ent->data) = erealloc(Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data) + 1);
- strlcpy(Z_STRVAL_P(ent->data) + Z_STRLEN_P(ent->data), decoded, Z_STRLEN_P(ent->data) + 1);
Z_STRVAL_P(ent->data)[Z_STRLEN_P(ent->data)] = '\0';
}