From: Masaki Kagaya Date: Sun, 1 Mar 2015 07:07:18 +0000 (+0900) Subject: replace emalloc with safe_emalloc X-Git-Tag: php-7.2.0alpha1~662^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a22d27df4cdabe6cab516c1f967d56cc5a8fb891;p=php replace emalloc with safe_emalloc --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 86f6969357..a646d158e5 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2103,25 +2103,25 @@ static inline int php_mb_check_code_point(long cp) if (cp < 0x100) { buf_len = 1; - buf = emalloc(buf_len); + buf = (char *) safe_emalloc(buf_len, 1, 1); buf[0] = cp; buf[1] = 0; } else if (cp < 0x10000) { buf_len = 2; - buf = emalloc(buf_len); + buf = (char *) safe_emalloc(buf_len, 1, 1); buf[0] = cp >> 8; buf[1] = cp & 0xff; buf[2] = 0; } else if (cp < 0x1000000) { buf_len = 3; - buf = emalloc(buf_len); + buf = (char *) safe_emalloc(buf_len, 1, 1); buf[0] = cp >> 16; buf[1] = (cp >> 8) & 0xff; buf[2] = cp & 0xff; buf[3] = 0; } else { buf_len = 4; - buf = emalloc(buf_len); + buf = (char *) safe_emalloc(buf_len, 1, 1); buf[0] = cp >> 24; buf[1] = (cp >> 16) & 0xff; buf[2] = (cp >> 8) & 0xff;