From ca1c2f06eab03e8bdb7283c4f551d96b6cdecfe3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Fri, 2 Jan 2004 23:35:59 +0000 Subject: [PATCH] prevent module from segfaulting when not configured. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102145 13f79535-47bb-0310-9956-ffa450edef68 --- modules/loggers/mod_log_forensic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/loggers/mod_log_forensic.c b/modules/loggers/mod_log_forensic.c index 23aadf0d74..16f17e90d5 100644 --- a/modules/loggers/mod_log_forensic.c +++ b/modules/loggers/mod_log_forensic.c @@ -222,6 +222,10 @@ static int log_before(request_rec *r) int n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + if (!(id = apr_table_get(r->subprocess_env, "UNIQUE_ID"))) { /* we make the assumption that we can't go through all the PIDs in under 1 second */ @@ -270,6 +274,10 @@ static int log_after(request_rec *r) int l,n; apr_status_t rv; + if (!cfg->fd) { + return DECLINED; + } + s = apr_pstrcat(r->pool, "-", id, "\n", NULL); l = n = strlen(s); rv = apr_file_write(cfg->fd, s, &n); -- 2.50.1