]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: MARK: Sanitize MARK_xlate()
authorPhil Sutter <phil@nwl.cc>
Thu, 17 Nov 2022 15:01:11 +0000 (16:01 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 24 Nov 2022 09:24:06 +0000 (10:24 +0100)
Since markinfo->mode might contain unexpected values, add a default case
returning zero.

Fixes: afefc7a134ca0 ("extensions: libxt_MARK: Add translation for revision 1 to nft")
Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/libxt_MARK.c

index 1536563d0f4c7fafcd23e73de5550c477effaf28..100f6a38996ac19616203ba05501a862080a3b1d 100644 (file)
@@ -366,6 +366,8 @@ static int MARK_xlate(struct xt_xlate *xl,
        case XT_MARK_OR:
                xt_xlate_add(xl, "mark or 0x%x ", (uint32_t)markinfo->mark);
                break;
+       default:
+               return 0;
        }
 
        return 1;