]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
expr_postprocess: Avoid an unintended fall through
authorPhil Sutter <phil@nwl.cc>
Thu, 20 May 2021 13:11:37 +0000 (15:11 +0200)
committerPhil Sutter <phil@nwl.cc>
Thu, 20 May 2021 14:55:02 +0000 (16:55 +0200)
Parsing a range expression, the switch case fell through to prefix
expression case, thereby recursing once more for expr->left. This seems
not to have caused harm, but is certainly not intended.

Fixes: ee4391d0ac1e7 ("nat: transform range to prefix expression when possible")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/netlink_delinearize.c

index 75869d330ef4d1b756121fece0ca796ea959146d..a71d06d7fe12f2f0e8410a134e55cdbef91e0b5b 100644 (file)
@@ -2450,6 +2450,7 @@ static void expr_postprocess(struct rule_pp_ctx *ctx, struct expr **exprp)
        case EXPR_RANGE:
                expr_postprocess(ctx, &expr->left);
                expr_postprocess(ctx, &expr->right);
+               break;
        case EXPR_PREFIX:
                expr_postprocess(ctx, &expr->prefix);
                break;