From nobody Wed Nov 01 09:06:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SL1MP4MLzz503nm; Wed, 1 Nov 2023 09:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SL1MP1Kn9z3K1L; Wed, 1 Nov 2023 09:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698829569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fH5IydDJkINmvswSv9/H5FUTv2M3qNAjHL/gsX07s5Q=; b=DRN9685UGVnExgFZ9Rv5+CH30vHlVuV3xFV4aCbmcdx/sVY86oFvhBMZXJvRJBlvKs21Fl aLZhqgK9RXw+WyCirsRalgLPO3f/fZNJQpbrAWiqrx9cnInKxTjoHv/PBdBvDqZLwQ0d2J 6glDtBfr14DttZEBSilE6nZEVErdvG/Zl8+eBUx5hm4arnjBwllyZqrZ4RMfYaAwqQ7nXF 35iPi4KEmEGJIJVo8q5RikYdifqMH19+MvUK1yyPUks0SIiee05Y4hpvmGtjAOMdoBCTgm rSWrEivB2CPcylCcBW7ytMh9z9h+WTM4HjK0dSp6M0j/7pQU4OPyHqYcuOhETA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698829569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fH5IydDJkINmvswSv9/H5FUTv2M3qNAjHL/gsX07s5Q=; b=pczDZBWUh+a8+IPKal0bhfba6FHcCM1lni7hYnb7WDppmhBx+79gSFckMm/S8vTP9uqTiF EUzV/UHP2Th6jHxEfWyMOuQaG0XLXdYYBkDqsYOf4nmQHqLg9MGQJiIfapTZqlOZeWLcjT C8w3v8uD3/orxD8vivlG2Md+fxQLEWR4eB1cVk+lZ8n39ikRRXXSGDq/ZfxhdFOrYNrGsW OmkuZq1bHQ4QhVii5RNHVWeLgjCyTlZlhMttzdSnLUVhM/C2F0oQctxOmsHPRbhDA6pe63 kQcLt/6Fi+2UfAy8/xGW268Lu9s/C+SLUcAbE7r+ZwVSArCYHIdSCqdNI2EgHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698829569; a=rsa-sha256; cv=none; b=Jqi2QWIBfczAufWYsdMss/CZKZAWbjtpdomRC+gTz9wt05E4z/OoXu6uelCmnM0nAB79Wu Z9elYAzX+zfe8tLBhNl0aGLzS36bVoyTk/vwzwGx6Jg2sDyzpknO0VSFmckHycWZGjb9uQ q1P9FFrgodh3Ci0H0Fkb9tL95OnIO5ayBEMFODFjMSCC7eYlYhxAkqAn9VzU1Byg0abSry hQylMDD8OPpM63cEtGV6tTbDi9Yb0fFoBnC+neU0i4001iWZaxHvkNpnjs4+OnPnVeAntf rCjqHRQm2ygV05utaXBU6mY2ReMZjXAKcucPGlhJ82qIMHNI4anDLRnaMfiWZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SL1MN6w9NzghV; Wed, 1 Nov 2023 09:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A1968J6065296; Wed, 1 Nov 2023 09:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A1968Uo065292; Wed, 1 Nov 2023 09:06:08 GMT (envelope-from git) Date: Wed, 1 Nov 2023 09:06:08 GMT Message-Id: <202311010906.3A1968Uo065292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c2e7cbe0edb5 - stable/13 - libpfctl: fix Coverity issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2e7cbe0edb5d3f834aba93311ba8ed027e5dd40 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2e7cbe0edb5d3f834aba93311ba8ed027e5dd40 commit c2e7cbe0edb5d3f834aba93311ba8ed027e5dd40 Author: Kristof Provost AuthorDate: 2023-10-23 11:46:11 +0000 Commit: Kristof Provost CommitDate: 2023-10-31 08:11:36 +0000 libpfctl: fix Coverity issues - handle snl_finalize_msg() returning NULL - insert the correct data into the states list - add missing nvlist_destroy() - incorrect order for array bounds Coverity: 1522929, 1522925, 1522923, 1522921, 1522780, 1522770, 1522764, 1487785, 1471250 Reviewed by: emaste MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42330 (cherry picked from commit 4abc3b482e0d246cd3518622223795c8de102130) --- lib/libpfctl/libpfctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c9a5190d790c..e0fc90960d7c 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -636,9 +636,9 @@ pfctl_add_rule(int dev, const struct pfctl_rule *r, const char *anchor, pfctl_nv_add_rule_addr(nvlr, "dst", &r->dst); labelcount = 0; - while (r->label[labelcount][0] != 0 && - labelcount < PF_RULE_MAX_LABEL_COUNT) { - nvlist_append_string_array(nvlr, "labels", + while (labelcount < PF_RULE_MAX_LABEL_COUNT && + r->label[labelcount][0] != 0) { + nvlist_append_string_array(nvl, "labels", r->label[labelcount]); labelcount++; }