diff options
author | Edward Rudd <urkle@outoforder.cc> | 2008-10-23 06:56:41 (GMT) |
---|---|---|
committer | Edward Rudd <urkle@outoforder.cc> | 2008-10-23 06:56:41 (GMT) |
commit | 50af087b9f3831285869dc8d8bf91cc3e6d5169a (patch) | |
tree | 2654017cf9aac96b7d0c57aaf913af786fd997d8 /utility/logparse.c | |
parent | aed9f10440d8789f99919c3a6f91e8d76bbc44dc (diff) |
fix possible crash when regex function doesn't match (set to *default*)
Diffstat (limited to 'utility/logparse.c')
-rw-r--r-- | utility/logparse.c | 3 |
1 files changed, 3 insertions, 0 deletions
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, | |||
40 | 40 | ||
41 | if (!ap_regexec(data->rx, value, AP_MAX_REG_MATCH, regm, 0)) { | 41 | if (!ap_regexec(data->rx, value, AP_MAX_REG_MATCH, regm, 0)) { |
42 | *ret = ap_pregsub(p, data->substr, value, AP_MAX_REG_MATCH, regm); | 42 | *ret = ap_pregsub(p, data->substr, value, AP_MAX_REG_MATCH, regm); |
43 | } else { | ||
44 | *ret = field->def; | ||
43 | } | 45 | } |
44 | //printf("We matched %s against %s to %s\n",value, field->args[0], *ret); | 46 | //printf("We matched %s against %s to %s\n",value, field->args[0], *ret); |
45 | return APR_SUCCESS; | 47 | return APR_SUCCESS; |
@@ -51,6 +53,7 @@ static apr_status_t parser_func_totimestamp(apr_pool_t *p, config_t *cfg, | |||
51 | time_t time; | 53 | time_t time; |
52 | struct tm ts; | 54 | struct tm ts; |
53 | 55 | ||
56 | //memset(&ts,0,sizeof(struct tm)); | ||
54 | 57 | ||
55 | strptime(value, "%d/%b/%Y:%H:%M:%S %z", &ts); | 58 | strptime(value, "%d/%b/%Y:%H:%M:%S %z", &ts); |
56 | time = mktime(&ts); | 59 | time = mktime(&ts); |