Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2009 19:30:32 +0000 (UTC)
From:      Max Laier <mlaier@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196551 - head/sys/contrib/pf/net
Message-ID:  <200908251930.n7PJUWn3037398@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mlaier
Date: Tue Aug 25 19:30:32 2009
New Revision: 196551
URL: http://svn.freebsd.org/changeset/base/196551

Log:
  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

Modified:
  head/sys/contrib/pf/net/pf_if.c

Modified: head/sys/contrib/pf/net/pf_if.c
==============================================================================
--- head/sys/contrib/pf/net/pf_if.c	Tue Aug 25 19:07:26 2009	(r196550)
+++ head/sys/contrib/pf/net/pf_if.c	Tue Aug 25 19:30:32 2009	(r196551)
@@ -663,7 +663,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908251930.n7PJUWn3037398>