Module Name: src Committed By: mrg Date: Wed Jun 22 04:02:47 UTC 2011
Modified Files: src/usr.sbin/mrinfo: mrinfo.c Log Message: fix the length argument to a memcpy() to refer to the size of the destination, not the size of the pointer. real bug on 64 bit platforms. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/mrinfo/mrinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/mrinfo/mrinfo.c diff -u src/usr.sbin/mrinfo/mrinfo.c:1.27 src/usr.sbin/mrinfo/mrinfo.c:1.28 --- src/usr.sbin/mrinfo/mrinfo.c:1.27 Fri Apr 17 14:07:45 2009 +++ src/usr.sbin/mrinfo/mrinfo.c Wed Jun 22 04:02:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mrinfo.c,v 1.27 2009/04/17 14:07:45 lukem Exp $ */ +/* $NetBSD: mrinfo.c,v 1.28 2011/06/22 04:02:46 mrg Exp $ */ /* * This tool requests configuration info from a multicast router @@ -80,7 +80,7 @@ static char rcsid[] = "@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)"; #else -__RCSID("$NetBSD: mrinfo.c,v 1.27 2009/04/17 14:07:45 lukem Exp $"); +__RCSID("$NetBSD: mrinfo.c,v 1.28 2011/06/22 04:02:46 mrg Exp $"); #endif #endif @@ -373,7 +373,7 @@ hp->h_addr_list[0] = malloc(hp->h_length); if (hp->h_addr_list[0] == NULL) logit(LOG_ERR, errno, "malloc"); - memcpy(hp->h_addr_list[0], &target_addr, sizeof(hp->h_addr_list[0])); + memcpy(hp->h_addr_list[0], &target_addr, hp->h_length); hp->h_addr_list[1] = NULL; } else hp = gethostbyname(host);