From b56c6b24ffc72e2d733d87d4ae08051951e4f10d Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 31 Jul 2011 23:14:04 +0000 Subject: [PATCH] fix termination in sha-512 too --- ext/standard/crypt_sha512.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c index 708ad67caa..0955532131 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. */ -- 2.40.0