From: Frédéric Marchal Date: Wed, 2 Feb 2011 14:01:07 +0000 (+0000) Subject: Support for IPv6 addresses in Dansguardian's log X-Git-Tag: v2.3.2~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=473d6bd833c975fac74ca587ae00ecfa3e3d4b50;p=thirdparty%2Fsarg.git Support for IPv6 addresses in Dansguardian's log The buffer to hold an IP address read from Dansguardian's log wasn't big enough to contain an IPv6 address. The reading of such log was failing. --- diff --git a/dansguardian_log.c b/dansguardian_log.c index 69c077f..081b40b 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -37,7 +37,7 @@ void dansguardian_log(void) char year[10], mon[10], day[10]; char hour[15]; char user[MAXLEN], code1[255], code2[255]; - char ip[30]; + char ip[45]; char wdata[127]; char *url; char tmp6[MAXLEN]; @@ -119,7 +119,7 @@ void dansguardian_log(void) if (strcmp(user,"-") == 0) { strcpy(user,ip); - bzero(ip, 30); + ip[0]='\0'; } fprintf(fp_ou,"%s\t%d\t%s\t%s\t%s\t%s\t%s\n",user,idata,hour,ip,url,code1,code2); dansguardian_count++;