From: Stanislav Malyshev Date: Sun, 31 Jul 2011 23:14:04 +0000 (+0000) Subject: fix termination in sha-512 too X-Git-Tag: php-5.3.7RC5~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44add6d195fdcb9d0b1896336af6296ec0caf14f;p=php fix termination in sha-512 too --- diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index c3e4debe63..cbc97a328c 100644 --- a/ext/standard/crypt_sha512.c +++ b/ext/standard/crypt_sha512.c @@ -431,8 +431,8 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) if ((salt - (char *) 0) % __alignof__ (uint64_t) != 0) { char *tmp = (char *) alloca(salt_len + 1 + __alignof__(uint64_t)); - tmp[salt_len] = 0; salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_t), salt, salt_len); + copied_salt[salt_len] = 0; } /* Prepare for the real work. */