From 86f4d07c6bc7f5bdd6bab6d145974ec751f0b47c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Fri, 27 Aug 2010 13:16:43 +0000 Subject: [PATCH] Initialize the variables that are used to build the date range when command line option -d is used. It should prevent a segfault if the complex nesting of "if" fails to set a variable. Thanks to ItalianPenguin for reporting this bug. --- CMakeLists.txt | 2 +- ChangeLog | 3 ++- include/info.h | 2 +- util.c | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 893c78e..14c2970 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(sarg C) SET(sarg_VERSION 2) SET(sarg_REVISION "3.1-pre1") SET(sarg_BUILD "") -SET(sarg_BUILDDATE "Aug-25-2010") +SET(sarg_BUILDDATE "Aug-27-2010") INCLUDE(AddFileDependencies) INCLUDE(CheckIncludeFile) diff --git a/ChangeLog b/ChangeLog index c119ac6..a41db39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ SARG ChangeLog -Aug-17-2010 Version 2.3.1 +Aug-27-2010 Version 2.3.1 - Remove the distinct printf for the alpha architecture as it doesn't work anymore and is not necessary anyway. - Don't abort if "onload" or "script" is found in the user agent string. - Take the configured locale path into account when installing sarg. @@ -12,6 +12,7 @@ Aug-17-2010 Version 2.3.1 - Fix a problem with the progress indicator when reading from a compressed log file. - Report an error if the output directory is a subdirectory of the temporary directory. - Use a more robust protection against an attack using javascript in the useragent string. + - Prevent a segfault if the parameter passed to command line option -d is invalid (thanks to ItalianPenguin). Jun-21-2010 Version 2.3 - LDAP usertab added. diff --git a/include/info.h b/include/info.h index c76d936..70dfd87 100755 --- a/include/info.h +++ b/include/info.h @@ -1,3 +1,3 @@ -#define VERSION PACKAGE_VERSION" Aug-25-2010" +#define VERSION PACKAGE_VERSION" Aug-27-2010" #define PGM PACKAGE_NAME #define URL "http://sarg.sourceforge.net" diff --git a/util.c b/util.c index de65878..9cb4f31 100644 --- a/util.c +++ b/util.c @@ -1146,12 +1146,12 @@ char *fixtime(long long int elap) void date_from(char *date, int *dfrom, int *duntil) { - int d0; - int m0; - int y0; - int d1; - int m1; - int y1; + int d0=0; + int m0=0; + int y0=0; + int d1=0; + int m1=0; + int y1=0; if (isdigit(date[0])) { int next=-1; -- 2.47.2