From 5bc0861a8b0ccf4d5d3e4f8fa245d87d8491b774 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Tue, 24 Nov 2009 11:08:16 +0000 Subject: [PATCH] Fixed #50226 (Insufficient memory allocation for unicode string) - Patch by yoarvi at gmail dot com --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.50.1