cvs: php4(PHP_4_3) /ext/mbstring mbstring.c php_mbregex.c
| From: | Ilia Alshanetsky | Date: | Thu, 01 May 2003 21:08:47 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/mbstring mbstring.c php_mbregex.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20631@lists.php.net to get a copy of this message | ||
iliaa Thu May 1 17:08:47 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/mbstring mbstring.c php_mbregex.c
Log:
MFH
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.142.2.13 php4/ext/mbstring/mbstring.c:1.142.2.14
--- php4/ext/mbstring/mbstring.c:1.142.2.13 Fri Apr 25 13:40:28 2003
+++ php4/ext/mbstring/mbstring.c Thu May 1 17:08:47 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.142.2.13 2003/04/25 17:40:28 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.142.2.14 2003/05/01 21:08:47 iliaa Exp $ */
/*
* PHP4 Multibyte String module "mbstring"
@@ -894,7 +894,7 @@
list = (int*)php_mbstr_default_identify_list;
n = php_mbstr_default_identify_list_size;
}
- entry = (int *)emalloc(n*sizeof(int));
+ entry = (int *)safe_emalloc(n, sizeof(int), 0);
if (entry != NULL) {
MBSTRG(current_detect_order_list) = entry;
MBSTRG(current_detect_order_list_size) = n;
@@ -3038,7 +3038,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);
if (stack != NULL) {
stack_level = 0;
identd = mbfl_encoding_detector_new(elist, elistsz TSRMLS_CC);
@@ -3126,7 +3126,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);
if (stack != NULL) {
stack_level = 0;
n = 2;
@@ -3249,7 +3249,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);
if (convmap != NULL) {
mapelm = convmap;
mapsize = 0;
Index: php4/ext/mbstring/php_mbregex.c
diff -u php4/ext/mbstring/php_mbregex.c:1.18.2.7 php4/ext/mbstring/php_mbregex.c:1.18.2.8
--- php4/ext/mbstring/php_mbregex.c:1.18.2.7 Wed Apr 2 19:15:58 2003
+++ php4/ext/mbstring/php_mbregex.c Thu May 1 17:08:47 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mbregex.c,v 1.18.2.7 2003/04/03 00:15:58 moriyoshi Exp $ */
+/* $Id: php_mbregex.c,v 1.18.2.8 2003/05/01 21:08:47 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
@@ -145,7 +145,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);
if (pre->fastmap) {
pre->options = options;
pre->mbctype = mbctype;