From 0809d0fbaabbeafd5034aaf829e1b84d10cb64e1 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 22 Jul 2019 17:34:25 +0200 Subject: [PATCH] data_reg: Add a missing break in nftnl_data_reg_snprintf Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1510538 Upstream Status: libnftnl commit 4177002b26f02 commit 4177002b26f025891cc509b54dc76bcf98f1c35f Author: Phil Sutter Date: Thu Dec 14 20:40:20 2017 +0100 data_reg: Add a missing break in nftnl_data_reg_snprintf The code works fine as-is, but if reg_type == DATA_VALUE && output_format == NFTNL_OUTPUT_XML, we fall through to DATA_CHAIN case and therefore pointlessly check output_format again. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/expr/data_reg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c index a246952..7023202 100644 --- a/src/expr/data_reg.c +++ b/src/expr/data_reg.c @@ -207,6 +207,7 @@ int nftnl_data_reg_snprintf(char *buf, size_t size, default: break; } + break; case DATA_VERDICT: case DATA_CHAIN: switch(output_format) { @@ -220,6 +221,7 @@ int nftnl_data_reg_snprintf(char *buf, size_t size, default: break; } + break; default: break; } -- 1.8.3.1