memset(tmp, 1, 32);
}
*/
- str = zend_string_alloc(3 * Z_STRLEN_P(value), 0);
+ str = zend_string_safe_alloc(Z_STRLEN_P(value), 3, 0, 0);
p = (unsigned char *) ZSTR_VAL(str);
s = (unsigned char *) Z_STRVAL_P(value);
e = s + Z_STRLEN_P(value);
return;
}
- result = zend_string_alloc(ZSTR_LEN(input) + num_pad_chars, 0);
+ result = zend_string_safe_alloc(ZSTR_LEN(input), 1, num_pad_chars, 0);
ZSTR_LEN(result) = 0;
/* We need to figure out the left/right padding lengths. */
}
/* This is the theoretical max (will never get beyond len * 2 as long
* as we are converting from single-byte characters, though) */
- str = zend_string_alloc(len * 4, 0);
+ str = zend_string_safe_alloc(len, 4, 0, 0);
ZSTR_LEN(str) = 0;
while (pos > 0) {
c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s);