]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
expression: missing line in describe command with invalid expression
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 13 Feb 2024 16:09:20 +0000 (17:09 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 Jan 2025 23:41:55 +0000 (00:41 +0100)
commit 2b24dd29c5fa1c7e4cf44f0753752d25106273a0 upstream.

Before:

 duh@testbed:~# nft describe blah
 symbol expression, datatype invalid (invalid)duh@testbed:#

After:

 duh@testbed:~# nft describe blah
 symbol expression, datatype invalid (invalid)
 duh@testbed:#

Fixes: 48aca2de80a7 ("iptopt: fix crash with invalid field/type combo")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/expression.c

index ea11b60f2ad305332bc4b2f1309ffef4b37eb6ab..1c6b3fef71f67d87535355ec33f3fd1ea08bcaf4 100644 (file)
@@ -140,8 +140,10 @@ void expr_describe(const struct expr *expr, struct output_ctx *octx)
                nft_print(octx, "%s expression, datatype %s (%s)",
                          expr_name(expr), dtype->name, dtype->desc);
 
-               if (dtype == &invalid_type)
+               if (dtype == &invalid_type) {
+                       nft_print(octx, "\n");
                        return;
+               }
        }
 
        if (dtype->basetype != NULL) {