openbsd-ports/www/webalizer/patches/patch-dns_resolv_c
2011-01-05 08:19:18 +00:00

24 lines
1.2 KiB
Plaintext

$OpenBSD: patch-dns_resolv_c,v 1.5 2011/01/05 08:19:18 giovanni Exp $
--- dns_resolv.c.orig Mon Oct 4 19:30:36 2010
+++ dns_resolv.c Mon Jan 3 11:45:53 2011
@@ -244,7 +244,7 @@ int dns_resolver(void *log_fp)
continue; /* go get next record if any */
}
- strcpy(tmp_buf, buffer); /* save buffer in case of error */
+ strlcpy(tmp_buf, buffer, sizeof(tmp_buf)); /* save buffer in case of error */
if(parse_record(buffer)) /* parse the record */
{
struct addrinfo hints, *ares;
@@ -418,8 +418,8 @@ static void process_list(DNODEPTR l_list)
{
/* If long hostname, take max domain name part */
if ((size = strlen(hbuf)) > MAXHOST-2)
- strcpy(child_buf,(hbuf+(size-MAXHOST+1)));
- else strcpy(child_buf, hbuf);
+ strlcpy(child_buf,(hbuf+(size-MAXHOST+1)),sizeof(child_buf));
+ else strlcpy(child_buf, hbuf,sizeof(child_buf));
size = strlen(child_buf);
}
else