mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fix crash when server_context is not longer valid (e.g., when
coming from php_apache_request_shutdown)
This commit is contained in:
parent
8bff24d65b
commit
6d77362190
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
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;
|
((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
|
||||||
send_http_header((request_rec *) SG(server_context));
|
send_http_header((request_rec *) SG(server_context));
|
||||||
return SAPI_HEADER_SENT_SUCCESSFULLY;
|
return SAPI_HEADER_SENT_SUCCESSFULLY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue