Projects
home:Eustace:branches:Eulaceura:Factory
nftables
_service:obs_scm:backport-evaluate-handle-inval...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-evaluate-handle-invalid-mapping-expressions-graceful.patch of Package nftables
From 778e4e113673c2a4daa798634c554c40f2808276 Mon Sep 17 00:00:00 2001 From: Florian Westphal <fw@strlen.de> Date: Mon, 4 Dec 2023 17:47:50 +0100 Subject: [PATCH] evaluate: handle invalid mapping expressions gracefully Before: BUG: invalid mapping expression binop nft: src/evaluate.c:2027: expr_evaluate_map: Assertion `0' failed. After: tests/shell/testcases/bogons/nft-f/invalid_mapping_expr_binop_assert:1:22-25: Error: invalid mapping expression binop xy mame ip saddr map h& p p ~~~~~~~~ ^^^^ Signed-off-by: Florian Westphal <fw@strlen.de> --- src/evaluate.c | 4 ++-- .../testcases/bogons/nft-f/invalid_mapping_expr_binop_assert | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 tests/shell/testcases/bogons/nft-f/invalid_mapping_expr_binop_assert diff --git a/src/evaluate.c b/src/evaluate.c index 64deb31a..b6428018 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2024,8 +2024,8 @@ static int expr_evaluate_map(struct eval_ctx *ctx, struct expr **expr) "Expression is not a map"); break; default: - BUG("invalid mapping expression %s\n", - expr_name(map->mappings)); + return expr_binary_error(ctx->msgs, map->mappings, map->map, + "invalid mapping expression %s", expr_name(map->mappings)); } if (!datatype_equal(map->map->dtype, map->mappings->set->key->dtype)) diff --git a/tests/shell/testcases/bogons/nft-f/invalid_mapping_expr_binop_assert b/tests/shell/testcases/bogons/nft-f/invalid_mapping_expr_binop_assert new file mode 100644 index 00000000..7205ff4f --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/invalid_mapping_expr_binop_assert @@ -0,0 +1 @@ +xy mame ip saddr map h& p p -- 2.43.4
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2