php-src/sapi/fpm
Niels Dossche dd3aa18545
Fix incorrect check in fpm_shm_free() (#13797)
`if (fpm_shm_size - size > 0)` will be rewritten by the compiler as this: `if (fpm_shm_size != size)`, which is undesirable. The reason this happens is that both variables are size_t, so subtracting them cannot be negative. The only way it can be not > 0, is if they're equal because the result will then be 0. This means that the else branch won't work properly. E.g. if `fpm_shm_size == 50` and `size == 51`, then `fpm_shm_size` will wraparound instead of becoming zero.

To showcase that the compiler actually does this, take a look at this
isolated case: https://godbolt.org/z/azobdWcrY. Here we can see the
usage of the compare instruction + cmove, so the "then" branch
is only done if the variables are equal.
2024-03-24 13:57:08 +01:00
..
fpm Fix incorrect check in fpm_shm_free() (#13797) 2024-03-24 13:57:08 +01:00
tests Fix bug #75712: getenv in php-fpm should not read $_ENV, $_SERVER 2024-02-04 11:58:18 +00:00
config.m4 Fix GH-13727: macro generating invalid call test prototypes fixes. 2024-03-18 06:53:39 +00:00
CREDITS
init.d.php-fpm.in Add configtest option to fpm init.d script 2015-03-08 22:48:29 +08:00
LICENSE
Makefile.frag Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
php-fpm.8.in Update year to 2024 2024-01-04 19:26:32 +01:00
php-fpm.conf.in Fix spelling and grammar mistakes 2021-04-13 12:09:37 +02:00
php-fpm.service.in Fix bug #79014 (PHP-FPM & Primary script unknown) 2020-02-23 19:14:05 +00:00
status.html.in Merge branch 'PHP-7.2' into PHP-7.3 2019-04-20 19:12:31 +02:00
www.conf.in Merge branch 'PHP-8.1' into PHP-8.2 2023-01-14 15:14:44 +00:00