From: Frederic Marchal Date: Mon, 3 Jun 2013 10:35:45 +0000 (+0200) Subject: Don't segfault if date_time_by is empty X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=94b6a6944045c0f5a026e674d62c652b2b8af7ed;p=thirdparty%2Fsarg.git Don't segfault if date_time_by is empty Thanks to nuphero for reporting this bug and helping in tracking it down. --- diff --git a/totday.c b/totday.c index 2d01186..e2cee78 100644 --- a/totday.c +++ b/totday.c @@ -100,6 +100,7 @@ void day_addpoint(DayObject ddata,const char *date, const char *time, long long int dayidx; int i; + if (!ddata) return; if (sscanf(date,"%d/%d/%d",&day,&month,&year)!=3) { debuga(_("Invalid date \"%s\" for the hourly statistics\n"),date); exit(EXIT_FAILURE);