From: Stanislav Malyshev Date: Sun, 31 Jul 2011 21:47:03 +0000 (+0000) Subject: fix salt truncation bug in sha256 X-Git-Tag: php-5.4.0alpha3~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c5dd2c36090e608d15efc8e1e386ebb77a02307;p=php fix salt truncation bug in sha256 --- diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index 231206bca1..d334e3d477 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -398,7 +398,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b char *tmp = (char *) alloca(salt_len + 1 + __alignof__(uint32_t)); salt = copied_salt = memcpy(tmp + __alignof__(uint32_t) - (tmp - (char *) 0) % __alignof__ (uint32_t), salt, salt_len); - tmp[salt_len] = 0; + copied_salt[salt_len] = 0; } /* Prepare for the real work. */