Skip to content

Commit 48b4922

Browse files
txunabukka
andcommitted
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>
1 parent 087f38f commit 48b4922

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PHP NEWS
99
- Date:
1010
. Fix leaks with multiple calls to DatePeriod iterator current(). (nielsdos)
1111

12+
- FPM:
13+
. Fixed GH-18662 (fpm_get_status segfault). (txuna)
14+
1215
- Intl:
1316
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
1417

sapi/fpm/fpm/fpm_request.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "zlog.h"
2323

2424
static const char *requests_stages[] = {
25+
[FPM_REQUEST_CREATING] = "Creating",
2526
[FPM_REQUEST_ACCEPTING] = "Idle",
2627
[FPM_REQUEST_READING_HEADERS] = "Reading headers",
2728
[FPM_REQUEST_INFO] = "Getting request information",

sapi/fpm/fpm/fpm_request.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const char *fpm_request_get_stage_name(int stage);
2525
int fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv);
2626

2727
enum fpm_request_stage_e {
28-
FPM_REQUEST_ACCEPTING = 1,
28+
FPM_REQUEST_CREATING,
29+
FPM_REQUEST_ACCEPTING,
2930
FPM_REQUEST_READING_HEADERS,
3031
FPM_REQUEST_INFO,
3132
FPM_REQUEST_EXECUTING,

0 commit comments

Comments
 (0)