cvs: php4(PHP_4_2_0) /sapi/apache2filter sapi_apache2.c
| From: | Aaron Bannert | Date: | Thu, 18 Apr 2002 16:34:49 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /sapi/apache2filter sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11199@lists.php.net to get a copy of this message | ||
aaron Thu Apr 18 12:34:49 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/sapi/apache2filter sapi_apache2.c
Log:
Fix an intermittent SEGV when an error bubbled up from PHP before our
server context was set. Now if that happens we simply don't log against
any particular server config (vhost).
Obtained from bug report by: Balazs Nagy <js@iksz.hu>
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.61.2.10
php4/sapi/apache2filter/sapi_apache2.c:1.61.2.11
--- php4/sapi/apache2filter/sapi_apache2.c:1.61.2.10 Thu Apr 18 12:25:50 2002
+++ php4/sapi/apache2filter/sapi_apache2.c Thu Apr 18 12:34:49 2002
@@ -211,7 +211,14 @@
* line. Not sure if this is correct, but it mirrors what happens
* with Apache 1.3 -- rbb
*/
- ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->r->server,
"%s", msg);
+ if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
+ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
+ 0, NULL, "%s", msg);
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
+ 0, ctx->r->server, "%s", msg);
+ }
}
static sapi_module_struct apache2_sapi_module = {