From: Kalle Sommer Nielsen Date: Tue, 24 Nov 2009 11:08:16 +0000 (+0000) Subject: Fixed #50226 (Insufficient memory allocation for unicode string) X-Git-Tag: php-5.4.0alpha1~191^2~2357 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bc0861a8b0ccf4d5d3e4f8fa245d87d8491b774;p=php Fixed #50226 (Insufficient memory allocation for unicode string) - Patch by yoarvi at gmail dot com --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 3a99b1c8a4..c889792d04 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3457,7 +3457,7 @@ PHP_FUNCTION(quotemeta) if (type == IS_UNICODE) { old_end.u = old.u + old_len; - str.u = safe_emalloc(2, UBYTES(old_len), 1); + str.u = safe_emalloc(2, UBYTES(old_len), UBYTES(1)); for (p.u = old.u, q.u = str.u; p.u != old_end.u; p.u++) { cp = *p.u;