From ce61f9400377b0db77716df190261dbc01daf085 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 15 Oct 2013 11:19:38 +0000 Subject: [PATCH] * support/rotatelogs.c (get_now): Fix the NULL ptr dereferences added in r1532281. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532289 13f79535-47bb-0310-9956-ffa450edef68 --- support/rotatelogs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/support/rotatelogs.c b/support/rotatelogs.c index b22110cfc2..7c203e59df 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -156,6 +156,7 @@ static void usage(const char *argv0, const char *reason) static int get_now(rotate_config_t *config, apr_int32_t *offset) { apr_time_t tNow = apr_time_now(); + int utc_offset; if (config->use_localtime) { /* Check for our UTC offset before using it, since it might @@ -164,13 +165,16 @@ static int get_now(rotate_config_t *config, apr_int32_t *offset) */ apr_time_exp_t lt; apr_time_exp_lt(<, tNow); - *offset = lt.tm_gmtoff; + utc_offset = lt.tm_gmtoff; } else { - *offset = config->utc_offset; + utc_offset = config->utc_offset; } - return (int)apr_time_sec(tNow) + *offset; + if (offset) + *offset = utc_offset; + + return (int)apr_time_sec(tNow) + utc_offset; } /* -- 2.40.0