git: 5a0cbbcaca6d - stable/12 - pfctl: rule.label is a two-dimensional array

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Tue, 31 Jan 2023 09:46:01 UTC
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a0cbbcaca6dcb656cb9d7b50de3a81654d02020

commit 5a0cbbcaca6dcb656cb9d7b50de3a81654d02020
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-01-24 06:46:46 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-01-31 03:29:52 +0000

    pfctl: rule.label is a two-dimensional array
    
    Fix checking for a non-empty first string.
    
    PR:             269075
    MFC after:      1 week
    Reported by:    nreilly@blackberry.com
    
    (cherry picked from commit cd80c52cade3e38d273eecec6f9b0a7cba23bcc8)
---
 sbin/pfctl/pfctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 5b170219e2ab..6fb7aeb45d00 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1130,7 +1130,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
 		case PFCTL_SHOW_LABELS:
 			break;
 		case PFCTL_SHOW_RULES:
-			if (rule.label[0] && (opts & PF_OPT_SHOWALL))
+			if (rule.label[0][0] && (opts & PF_OPT_SHOWALL))
 				labels = 1;
 			print_rule(&rule, anchor_call, rule_numbers, numeric);
 			printf("\n");
@@ -1184,7 +1184,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
 			break;
 		}
 		case PFCTL_SHOW_RULES:
-			if (rule.label[0] && (opts & PF_OPT_SHOWALL))
+			if (rule.label[0][0] && (opts & PF_OPT_SHOWALL))
 				labels = 1;
 			INDENT(depth, !(opts & PF_OPT_VERBOSE));
 			print_rule(&rule, anchor_call, rule_numbers, numeric);