summaryrefslogtreecommitdiff
path: root/sapi/apache
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-05-17 08:11:20 +0000
committerZeev Suraski <zeev@php.net>2000-05-17 08:11:20 +0000
commit6d77362190e6e1d8ac58beec661ef348ff3d38f0 (patch)
treefbfa846cbe0be5f900af14b70a7710294941aae0 /sapi/apache
parent8bff24d65b40c463bb3cf32aa11659d1ad04d0bc (diff)
downloadphp-git-6d77362190e6e1d8ac58beec661ef348ff3d38f0.tar.gz
Fix crash when server_context is not longer valid (e.g., when
coming from php_apache_request_shutdown)
Diffstat (limited to 'sapi/apache')
-rw-r--r--sapi/apache/mod_php4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 1dee7f9251..65b56c2302 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -227,6 +227,10 @@ int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
{
+ if(SG(server_context) == NULL) { /* server_context is not here anymore */
+ return SAPI_HEADER_SEND_FAILED;
+ }
+
((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
send_http_header((request_rec *) SG(server_context));
return SAPI_HEADER_SENT_SUCCESSFULLY;