Skip to content

Commit a83363e

Browse files
hwdedevnexen
authored andcommitted
FPM: Fix use after free in fpm_evaluate_full_path
Closes #8796.
1 parent 26feb2e commit a83363e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ PHP NEWS
4545
. Fixed ACL build check on MacOS. (David Carlier)
4646
. Fixed bug #72185: php-fpm writes empty fcgi record causing nginx 502.
4747
(Jakub Zelenka, loveharmful)
48+
. Fixes use after free. (Heiko Weber).
4849

4950
- Mysqlnd:
5051
. Fixed bug #81719: mysqlnd/pdo password buffer overflow. (CVE-2022-31626)

sapi/fpm/fpm/fpm_conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha
766766
}
767767

768768
if (strlen(*path) > strlen("$prefix")) {
769-
free(*path);
770769
tmp = strdup((*path) + strlen("$prefix"));
770+
free(*path);
771771
*path = tmp;
772772
} else {
773773
free(*path);

0 commit comments

Comments
 (0)