1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

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 cd80c52cad)
This commit is contained in:
Kristof Provost 2023-01-24 07:46:46 +01:00
parent 0eda98025d
commit f898638004

View File

@ -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);