Fix GH-18595: fpm_get_status segfault

This fixes null dereference error when calling fpm_get_status() and one
of the children is just being created.

Closes GH-18662

Co-authored-by: Jakub Zelenka <bukka@php.net>
This commit is contained in:
txuna 2025-05-26 13:25:21 +00:00 committed by Jakub Zelenka
parent 087f38f347
commit 48b492269b
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
3 changed files with 6 additions and 1 deletions

3
NEWS
View file

@ -9,6 +9,9 @@ PHP NEWS
- Date:
. Fix leaks with multiple calls to DatePeriod iterator current(). (nielsdos)
- FPM:
. Fixed GH-18662 (fpm_get_status segfault). (txuna)
- Intl:
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)

View file

@ -22,6 +22,7 @@
#include "zlog.h"
static const char *requests_stages[] = {
[FPM_REQUEST_CREATING] = "Creating",
[FPM_REQUEST_ACCEPTING] = "Idle",
[FPM_REQUEST_READING_HEADERS] = "Reading headers",
[FPM_REQUEST_INFO] = "Getting request information",

View file

@ -25,7 +25,8 @@ const char *fpm_request_get_stage_name(int stage);
int fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv);
enum fpm_request_stage_e {
FPM_REQUEST_ACCEPTING = 1,
FPM_REQUEST_CREATING,
FPM_REQUEST_ACCEPTING,
FPM_REQUEST_READING_HEADERS,
FPM_REQUEST_INFO,
FPM_REQUEST_EXECUTING,