1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00

I'm pretty sure you didn't mean to multiple by the size of a char* there

since that makes no sense. output is an array of char, not an array of
char*
Pierre, please review
This commit is contained in:
Rasmus Lerdorf
2011-08-07 00:36:26 +00:00
parent 99cb211c6c
commit b7a92c9709

View File

@@ -200,7 +200,7 @@ PHP_FUNCTION(crypt)
int needed = (sizeof(sha512_salt_prefix) - 1
+ sizeof(sha512_rounds_prefix) + 9 + 1
+ strlen(salt) + 1 + 43 + 1);
output = emalloc(needed * sizeof(char *));
output = emalloc(needed);
salt[salt_in_len] = '\0';
crypt_res = php_sha512_crypt_r(str, salt, output, needed);
@@ -223,7 +223,7 @@ PHP_FUNCTION(crypt)
int needed = (sizeof(sha256_salt_prefix) - 1
+ sizeof(sha256_rounds_prefix) + 9 + 1
+ strlen(salt) + 1 + 43 + 1);
output = emalloc(needed * sizeof(char *));
output = emalloc(needed);
salt[salt_in_len] = '\0';
crypt_res = php_sha256_crypt_r(str, salt, output, needed);