diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2003-05-01 21:08:31 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2003-05-01 21:08:31 +0000 |
| commit | 894e2aaf685da229122a1c054801fcd0c7c35484 (patch) | |
| tree | 269dfec9c767eb41382d7edb51ffcfbb80ca32a4 | |
| parent | 833d734af1558dddd074421407265f5651bf253e (diff) | |
| download | php-git-894e2aaf685da229122a1c054801fcd0c7c35484.tar.gz | |
emalloc -> safe_emalloc
| -rw-r--r-- | ext/mbstring/mbstring.c | 8 | ||||
| -rw-r--r-- | ext/mbstring/php_mbregex.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 8675ab0288..b461a03fe5 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -807,7 +807,7 @@ PHP_RINIT_FUNCTION(mbstring) 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 @@ PHP_FUNCTION(mb_convert_variables) /* 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 @@ detect_end: /* 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 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type) 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) { diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 27aef6cef1..c99a83e270 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -237,7 +237,7 @@ php_mbregex_compile_pattern(mb_regex_t *pre, const char *pattern, int patlen, in 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); |
