svn commit: r196680 - in stable/7/sys: . contrib/pf contrib/pf/net
Max Laier
mlaier at FreeBSD.org
Mon Aug 31 00:52:11 UTC 2009
Author: mlaier
Date: Mon Aug 31 00:52:10 2009
New Revision: 196680
URL: http://svn.freebsd.org/changeset/base/196680
Log:
MFC r196551:
Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.
Submitted by: pjd
Reviewed by: {krw,sthen,markus}@openbsd.org
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/contrib/pf/net/pf_if.c
Modified: stable/7/sys/contrib/pf/net/pf_if.c
==============================================================================
--- stable/7/sys/contrib/pf/net/pf_if.c Mon Aug 31 00:18:17 2009 (r196679)
+++ stable/7/sys/contrib/pf/net/pf_if.c Mon Aug 31 00:52:10 2009 (r196680)
@@ -660,7 +660,7 @@ pfi_address_add(struct sockaddr *sa, int
"(%d/%d)\n", pfi_buffer_cnt, PFI_BUFFER_MAX);
return;
}
- memcpy(pfi_buffer, p, pfi_buffer_cnt * sizeof(*pfi_buffer));
+ memcpy(p, pfi_buffer, pfi_buffer_max * sizeof(*pfi_buffer));
/* no need to zero buffer */
free(pfi_buffer, PFI_MTYPE);
pfi_buffer = p;
More information about the svn-src-stable
mailing list