summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2009-08-25 19:30:32 +0000
committermlaier <mlaier@FreeBSD.org>2009-08-25 19:30:32 +0000
commit11422085318b9fc044ba39ee2af6a6fc6d27f5b1 (patch)
tree9c9934f44f3acd561433bae939749dd2c758784a /sys
parent7bae5f082b1ead5d6efedbc7fba5e58295955967 (diff)
downloadFreeBSD-src-11422085318b9fc044ba39ee2af6a6fc6d27f5b1.zip
FreeBSD-src-11422085318b9fc044ba39ee2af6a6fc6d27f5b1.tar.gz
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 MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r--sys/contrib/pf/net/pf_if.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c
index a78a545..156fb22 100644
--- a/sys/contrib/pf/net/pf_if.c
+++ b/sys/contrib/pf/net/pf_if.c
@@ -663,7 +663,7 @@ pfi_address_add(struct sockaddr *sa, int af, int net)
"(%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;
OpenPOWER on IntegriCloud