}
raw_length = length * 3 / 4 + 1;
}
- buffer = (char *) emalloc(raw_length + 1);
+ buffer = (char *) safe_emalloc(raw_length, 1, 1);
#if PHP_WIN32
{
memcpy(ret, buffer, length);
} else {
char *result;
- result = emalloc(length + 1);
+ result = safe_emalloc(length, 1, 1);
if (php_password_salt_to64(buffer, raw_length, length, result) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Generated salt too short");
efree(buffer);
RETURN_NULL();
}
- salt = emalloc(length + 1);
+ salt = safe_emalloc(length, 1, 1);
if (php_password_make_salt(length, (int) raw_output, salt TSRMLS_CC) == FAILURE) {
efree(salt);
RETURN_FALSE;
salt[salt_len] = 0;
- hash = emalloc(salt_len + hash_format_len + 1);
+ hash = safe_emalloc(salt_len + hash_format_len, 1, 1);
sprintf(hash, "%s%s", hash_format, salt);
hash[hash_format_len + salt_len] = 0;