summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2015-08-24 21:41:05 +0000
committerloos <loos@FreeBSD.org>2015-08-24 21:41:05 +0000
commit0ecaa00f9d4b09fc327fd1b5c019322b303da59b (patch)
tree82aabf8562eb24b89b7c440bd82f0de2b6809753 /sys/netpfil
parent0b30a8e5927472010b9d4829240e9fa574929cae (diff)
downloadFreeBSD-src-0ecaa00f9d4b09fc327fd1b5c019322b303da59b.zip
FreeBSD-src-0ecaa00f9d4b09fc327fd1b5c019322b303da59b.tar.gz
Reapply r196551 which was accidentally reverted by r223637 (update to
OpenBSD pf 4.5). 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. This fix the failure when you hit the self table size and force it to be resized. MFC after: 3 days Sponsored by: Rubicon Communications (Netgate)
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/pf/pf_if.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netpfil/pf/pf_if.c b/sys/netpfil/pf/pf_if.c
index 2f12518..a2c9c7e 100644
--- a/sys/netpfil/pf/pf_if.c
+++ b/sys/netpfil/pf/pf_if.c
@@ -581,7 +581,7 @@ pfi_address_add(struct sockaddr *sa, int af, int net)
__func__, V_pfi_buffer_cnt, PFI_BUFFER_MAX);
return;
}
- memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer));
+ memcpy(p, V_pfi_buffer, V_pfi_buffer_max * sizeof(*V_pfi_buffer));
/* no need to zero buffer */
free(V_pfi_buffer, PFI_MTYPE);
V_pfi_buffer = p;
OpenPOWER on IntegriCloud