com php-src: replace emalloc with safe_emalloc: ext/mbstr ing/mbstring.c
| From: | Joe Watkins | Date: | Sun, 01 Mar 2015 07:07:18 +0000 |
| Subject: | com php-src: replace emalloc with safe_emalloc: ext/mbstr ing/mbstring.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96510@lists.php.net to get a copy of this message | ||
Commit: a22d27df4cdabe6cab516c1f967d56cc5a8fb891
Author: Masaki Kagaya <masakielastic@gmail.com> Sun, 1 Mar 2015 16:07:18 +0900
Parents: 45a8a9c6858a49118330002b59dbd88b37e31e9d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a22d27df4cdabe6cab516c1f967d56cc5a8fb891
Log:
replace emalloc with safe_emalloc
Changed paths:
M ext/mbstring/mbstring.c
Diff:
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 86f6969..a646d15 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;