[php-src] PR #18739: Update safe_bcmp.c
| From: | itashia | Date: | Mon, 02 Jun 2025 11:48:38 +0000 |
| Subject: | [php-src] PR #18739: Update safe_bcmp.c | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-31928@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/18739
Author: itashia
Refactor: Improve readability, documentation, and timing-attack resistance
- Added detailed comments explaining function behavior and security considerations
- Ensured timing-attack resistance by maintaining full loop execution
- Used local variables to store string lengths for better readability
- Replaced
while loop with for for improved clarity
- Removed unnecessary pre-declared variable i
- Preserved use of volatile to prevent unwanted compiler optimizations
- Renamed variables for clearer meaning
- Cleaned up code structure for better maintainability
- Preserved original algorithm and performance characteristics