From: Frédéric Marchal Date: Tue, 8 Jun 2010 18:45:18 +0000 (+0000) Subject: Remove the test on the string length for the date elements processed as integers... X-Git-Tag: v2.3-pre5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b35d691431346ead02e0e3de3616d11834a6e8;p=thirdparty%2Fsarg.git Remove the test on the string length for the date elements processed as integers (thanks to Joseph L. Casale) --- diff --git a/squidguard_log.c b/squidguard_log.c index f74e34d..fbf80ff 100644 --- a/squidguard_log.c +++ b/squidguard_log.c @@ -116,30 +116,17 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) exit(EXIT_FAILURE); } if(strcmp(leks,"year") == 0) { - if (strlen(res)>=sizeof(year)) { - debuga(_("Year string too long in redirector log file %s\n"),wentp); - exit(EXIT_FAILURE); - } year=atoi(res); } else if(strcmp(leks,"mon") == 0) { - if (strlen(res)>=sizeof(mon)) { - debuga(_("Month string too long in redirector log file %s\n"),wentp); - exit(EXIT_FAILURE); - } mon=atoi(res); } else if(strcmp(leks,"day") == 0) { - if (strlen(res)>=sizeof(day)) { - debuga(_("Day string too long in redirector log file %s\n"),wentp); - exit(EXIT_FAILURE); - } day=atoi(res); } else if(strcmp(leks,"hour") == 0) { if (strlen(res)>=sizeof(hour)) { debuga(_("Hour string too long in redirector log file %s\n"),wentp); exit(EXIT_FAILURE); } - strncpy(hour,res,sizeof(hour)-1); - hour[sizeof(hour)-1]='\0'; + strcpy(hour,res); } else if(strcmp(leks,"list") == 0) { if (strlen(res)>=sizeof(list)) { debuga(_("Banning list name too long in redirector log file %s\n"),wentp);