[php-src] PR #12937: Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB
| From: | nielsdos | Date: | Mon, 11 Dec 2023 22:56:19 +0000 |
| Subject: | [php-src] PR #12937: Fix GH-12936: hash() function hangs endlessly if using sha512 on strings >= 4GiB | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24500@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12937
Author: nielsdos
There's two problems:
- Some loops used
unsigned int instead of size_t.
- The 2*N-bit addition that is emulated using 2 N bit numbers has a bug: it first truncated the
number to 32/64 bit and only then shifted. This resulted in the wrong length info stored inside the
resulting hash.