summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bannert <aaron@php.net>2002-04-18 16:34:06 +0000
committerAaron Bannert <aaron@php.net>2002-04-18 16:34:06 +0000
commitd11ee7c1eaaedace7a78799bb3ee1c5c31459d30 (patch)
treeb6452615ae84054ba8db598620c86d94cbfd3a80
parentfd167a7d42f38f025e922955b30704bc55e062ff (diff)
downloadphp-git-d11ee7c1eaaedace7a78799bb3ee1c5c31459d30.tar.gz
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>
-rw-r--r--sapi/apache2filter/sapi_apache2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index e84fd3ede4..decc641570 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -211,7 +211,14 @@ static void php_apache_sapi_log_message(char *msg)
* 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 = {