From owner-svn-src-all@FreeBSD.ORG Mon Aug 31 00:52:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD2EE106568B; Mon, 31 Aug 2009 00:52:10 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB4AF8FC17; Mon, 31 Aug 2009 00:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7V0qApB011359; Mon, 31 Aug 2009 00:52:10 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7V0qA6P011357; Mon, 31 Aug 2009 00:52:10 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200908310052.n7V0qA6P011357@svn.freebsd.org> From: Max Laier Date: Mon, 31 Aug 2009 00:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196680 - in stable/7/sys: . contrib/pf contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2009 00:52:11 -0000 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;