$NetBSD: patch-ab,v 1.4 2006/03/02 21:03:39 wiz Exp $ --- greylist.c.orig 2005-09-16 11:52:41.000000000 +0200 +++ greylist.c @@ -20,8 +20,11 @@ pid=getpid(); ts=time(0); strncpy(oip,ip,sizeof(oip)-1); +oip[sizeof(oip)-1] = '\0'; strncpy(osender,sender,sizeof(osender)-1); +osender[sizeof(osender)-1] = '\0'; strncpy(orecipient,recipient,sizeof(orecipient)-1); +orecipient[sizeof(orecipient)-1] = '\0'; if(conf->debug==1) printf("%d: Starting the greylist algo\n",pid); @@ -97,6 +100,7 @@ if(conf->whitelist==1) if(domain==NULL) domain=osender; strncpy(netw,oip,sizeof(netw)-1); + netw[sizeof(netw)-1] = '\0'; l=strlen(netw); for(i=l-1;i>=0;i--) { @@ -127,7 +131,7 @@ if(conf->dnswl[0]!=0) if(x==4) { snprintf(query,sizeof(query)-1,"%d.%d.%d.%d.%s",d,c,b,a,conf->dnswl); - n=DnsIp(query,NULL); + n=DnsIp(query,NULL, 0); if(conf->debug==1) printf("%d: DNSQuery=(%s) result=%ld\n",pid,query,n); if(n==0) {