From c75e6f19307ffdecf1f99205f31c3aa61cde7350 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Thu, 5 Aug 2021 15:38:40 +0100 Subject: [PATCH v4 03/10] extensions: libxt_NFLOG: only send the prefix if it is not empty. `info->prefix` is an array, not a pointer, and so is never `NULL`. Signed-off-by: Jeremy Sowden --- iptables/nft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iptables/nft.c b/iptables/nft.c index 13cbf0a8b87b..e5e5b8e1046b 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -1364,7 +1364,7 @@ int add_log(struct nftnl_rule *r, struct iptables_command_state *cs) if (!expr) return -ENOMEM; - if (info->prefix != NULL) { + if (info->prefix[0] != '\0') { nftnl_expr_set_str(expr, NFTNL_EXPR_LOG_PREFIX, cs->target->udata); } if (info->group) { -- 2.30.2