summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_php_sapi.c
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2021-12-02 18:42:23 +0300
committerAndrei Belov <defan@nginx.com>2021-12-02 18:42:23 +0300
commit7634ab0f21c712e79c5d09e5817f866ff71d4f49 (patch)
tree1c4b20be29a9372858088c9faa3f02e7f584402f /src/nxt_php_sapi.c
parent5dfde9717d9ef611072defdd211089efa920c728 (diff)
parent85908c09f9b7d8d0bd797427d984e2697ece8267 (diff)
downloadunit-1.26.1-1.tar.gz
unit-1.26.1-1.tar.bz2
Merged with the 1.26 branch.1.26.1-1
Diffstat (limited to '')
-rw-r--r--src/nxt_php_sapi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
index ea5f5581..68ef07eb 100644
--- a/src/nxt_php_sapi.c
+++ b/src/nxt_php_sapi.c
@@ -204,7 +204,10 @@ ZEND_NAMED_FUNCTION(nxt_php_chdir)
nxt_php_run_ctx_t *ctx;
ctx = SG(server_context);
- ctx->chdir = 1;
+
+ if (nxt_fast_path(ctx != NULL)) {
+ ctx->chdir = 1;
+ }
nxt_php_chdir_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
@@ -225,7 +228,7 @@ PHP_FUNCTION(fastcgi_finish_request)
ctx = SG(server_context);
- if (nxt_slow_path(ctx->req == NULL)) {
+ if (nxt_slow_path(ctx == NULL || ctx->req == NULL)) {
RETURN_FALSE;
}