stas Sun, 31 Jul 2011 23:14:04 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=314003
Log: fix termination in sha-512 too Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/crypt_sha512.c U php/php-src/branches/PHP_5_4/ext/standard/crypt_sha512.c U php/php-src/trunk/ext/standard/crypt_sha512.c Modified: php/php-src/branches/PHP_5_3/ext/standard/crypt_sha512.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/standard/crypt_sha512.c 2011-07-31 22:43:21 UTC (rev 314002) +++ php/php-src/branches/PHP_5_3/ext/standard/crypt_sha512.c 2011-07-31 23:14:04 UTC (rev 314003) @@ -431,8 +431,8 @@ 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. */ Modified: php/php-src/branches/PHP_5_4/ext/standard/crypt_sha512.c =================================================================== --- php/php-src/branches/PHP_5_4/ext/standard/crypt_sha512.c 2011-07-31 22:43:21 UTC (rev 314002) +++ php/php-src/branches/PHP_5_4/ext/standard/crypt_sha512.c 2011-07-31 23:14:04 UTC (rev 314003) @@ -431,8 +431,8 @@ 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. */ Modified: php/php-src/trunk/ext/standard/crypt_sha512.c =================================================================== --- php/php-src/trunk/ext/standard/crypt_sha512.c 2011-07-31 22:43:21 UTC (rev 314002) +++ php/php-src/trunk/ext/standard/crypt_sha512.c 2011-07-31 23:14:04 UTC (rev 314003) @@ -431,8 +431,8 @@ 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. */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php