git: 08d01204175d - main - snmp_pf: fix rules->label use

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Fri, 21 Feb 2025 09:11:27 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=08d01204175dae496742e9ccd570363b267284e8

commit 08d01204175dae496742e9ccd570363b267284e8
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-02-21 08:49:06 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-02-21 08:49:06 +0000

    snmp_pf: fix rules->label use
    
    We now support multiple lables on a rule, so 'rule' is an array of strings, not
    just one string. Adjust the check for 'is there a label?'.
    
    CID:            1471808
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
index 782e5503c8a3..0e40bcfb843e 100644
--- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
@@ -1531,7 +1531,7 @@ pfl_scan_ruleset(const char *path)
 			goto err;
 		}
 
-		if (rule.label[0]) {
+		if (rule.label[0][0]) {
 			e = (struct pfl_entry *)malloc(sizeof(*e));
 			if (e == NULL)
 				goto err;