From 306d3fb23d7ccbc327b6038df2088629daff87b4 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 1 Feb 2024 22:32:32 +0100 Subject: [PATCH] libpfct: fix incorrect array check Reported by: Coverity Scan CID: 1523771 Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index cb9b377f7b6c..71546c4709c2 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -965,8 +965,8 @@ snl_add_msg_attr_rule_labels(struct snl_writer *nw, uint32_t type, const char la off = snl_add_msg_attr_nested(nw, type); - while (labels[i][0] != 0 && - i < PF_RULE_MAX_LABEL_COUNT) { + while (i < PF_RULE_MAX_LABEL_COUNT && + labels[i][0] != 0) { snl_add_msg_attr_string(nw, PF_LT_LABEL, labels[i]); i++; }