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;
/* 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);
/* 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;
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;
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;