cvs: php4 /ext/mbstring mbstring.c php_mbregex.c
| From: | Ilia Alshanetsky | Date: | Thu, 01 May 2003 21:08:31 +0000 |
| Subject: | cvs: php4 /ext/mbstring mbstring.c php_mbregex.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20630@lists.php.net to get a copy of this message | ||
iliaa Thu May 1 17:08:31 2003 EDT
Modified files:
/php4/ext/mbstring mbstring.c php_mbregex.c
Log:
emalloc -> safe_emalloc
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.172 php4/ext/mbstring/mbstring.c:1.173
--- php4/ext/mbstring/mbstring.c:1.172 Fri Apr 25 13:39:46 2003
+++ php4/ext/mbstring/mbstring.c Thu May 1 17:08:31 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.172 2003/04/25 17:39:46 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.173 2003/05/01 21:08:31 iliaa Exp $ */
/*
* PHP4 Multibyte String module "mbstring"
@@ -807,7 +807,7 @@
list = (int*)php_mb_default_identify_list;
n = php_mb_default_identify_list_size;
}
- entry = (int *)emalloc(n*sizeof(int));
+ entry = (int *)safe_emalloc(n, sizeof(int), 0);
MBSTRG(current_detect_order_list) = entry;
MBSTRG(current_detect_order_list_size) = n;
while (n > 0) {
@@ -2391,7 +2391,7 @@
/* auto detect */
from_encoding = mbfl_no_encoding_invalid;
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (pval ***)emalloc(stack_max*sizeof(pval **));
+ stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0);
stack_level = 0;
identd = mbfl_encoding_detector_new(elist, elistsz TSRMLS_CC);
if (identd != NULL) {
@@ -2474,7 +2474,7 @@
/* convert */
if (convd != NULL) {
stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (pval ***)emalloc(stack_max*sizeof(pval **));
+ stack = (pval ***)safe_emalloc(stack_max, sizeof(pval **), 0);
stack_level = 0;
n = 2;
while (n < argc || stack_level > 0) {
@@ -2592,7 +2592,7 @@
zend_hash_internal_pointer_reset(target_hash);
i = zend_hash_num_elements(target_hash);
if (i > 0) {
- convmap = (int *)emalloc(i*sizeof(int));
+ convmap = (int *)safe_emalloc(i, sizeof(int), 0);
mapelm = convmap;
mapsize = 0;
while (i > 0) {
Index: php4/ext/mbstring/php_mbregex.c
diff -u php4/ext/mbstring/php_mbregex.c:1.38 php4/ext/mbstring/php_mbregex.c:1.39
--- php4/ext/mbstring/php_mbregex.c:1.38 Wed Apr 2 19:15:13 2003
+++ php4/ext/mbstring/php_mbregex.c Thu May 1 17:08:31 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mbregex.c,v 1.38 2003/04/03 00:15:13 moriyoshi Exp $ */
+/* $Id: php_mbregex.c,v 1.39 2003/05/01 21:08:31 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
@@ -237,7 +237,7 @@
if(zend_hash_find(&MBSTRG(ht_rc), (char *)pattern, patlen+1, (void **) &rc) == FAILURE ||
rc->options != options || rc->mbctype != mbctype) {
memset(pre, 0, sizeof(*pre));
- pre->fastmap = (char*)emalloc((1 << MBRE_BYTEWIDTH)*sizeof(char));
+ pre->fastmap = (char*)safe_emalloc((1 << MBRE_BYTEWIDTH), sizeof(char), 0);
pre->options = options;
pre->mbctype = mbctype;
err_str = mbre_compile_pattern(pattern, patlen, pre);