From 50af087b9f3831285869dc8d8bf91cc3e6d5169a Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Thu, 23 Oct 2008 06:56:41 +0000 Subject: fix possible crash when regex function doesn't match (set to *default*) --- (limited to 'utility/logparse.c') diff --git a/utility/logparse.c b/utility/logparse.c index e9ca340..dfe2e9b 100644 --- a/utility/logparse.c +++ b/utility/logparse.c @@ -40,6 +40,8 @@ static apr_status_t parser_func_regexmatch(apr_pool_t *p, config_t *cfg, if (!ap_regexec(data->rx, value, AP_MAX_REG_MATCH, regm, 0)) { *ret = ap_pregsub(p, data->substr, value, AP_MAX_REG_MATCH, regm); + } else { + *ret = field->def; } //printf("We matched %s against %s to %s\n",value, field->args[0], *ret); return APR_SUCCESS; @@ -51,6 +53,7 @@ static apr_status_t parser_func_totimestamp(apr_pool_t *p, config_t *cfg, time_t time; struct tm ts; + //memset(&ts,0,sizeof(struct tm)); strptime(value, "%d/%b/%Y:%H:%M:%S %z", &ts); time = mktime(&ts); -- cgit v0.9.2