cvs: php4 /sapi/apache/ mod_php4.c
| From: | Zeev Suraski | Date: | Wed, 17 May 2000 08:11:20 +0000 |
| Subject: | cvs: php4 /sapi/apache/ mod_php4.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-15114@lists.php.net to get a copy of this message | ||
zeev Wed May 17 10:11:20 2000 EDT
Modified files:
/php4/sapi/apache mod_php4.c
Log:
Fix crash when server_context is not longer valid (e.g., when
coming from php_apache_request_shutdown)
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.47 php4/sapi/apache/mod_php4.c:1.48
--- php4/sapi/apache/mod_php4.c:1.47 Sun May 14 18:05:25 2000
+++ php4/sapi/apache/mod_php4.c Wed May 17 10:11:20 2000
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.47 2000/05/14 16:05:25 zeev Exp $ */
+/* $Id: mod_php4.c,v 1.48 2000/05/17 08:11:20 zeev Exp $ */
#define NO_REGEX_EXTRA_H
#ifdef WIN32
@@ -227,6 +227,10 @@
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;