From c2b35d691431346ead02e0e3de3616d11834a6e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Tue, 8 Jun 2010 18:45:18 +0000 Subject: [PATCH] Remove the test on the string length for the date elements processed as integers (thanks to Joseph L. Casale) --- squidguard_log.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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); -- 2.47.2