Projects
openEuler:24.03:SP1:Everything:64G
nftables
_service:tar_scm:backport-evaluate-handle-inval...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-evaluate-handle-invalid-mapping-expressions-in-stateful-object-statements-gracefully.patch of Package nftables
From 52a7af9bec15a4fb4bfea86e40b70f96098f7dfd Mon Sep 17 00:00:00 2001 From: Jeremy Sowden <jeremy@azazel.net> Date: Mon, 29 Apr 2024 20:27:52 +0100 Subject: [PATCH] evaluate: handle invalid mapping expressions in stateful object statements gracefully. Currently, they are reported as assertion failures: BUG: invalid mapping expression variable nft: src/evaluate.c:4618: stmt_evaluate_objref_map: Assertion `0' failed. Aborted Instead, report them more informatively as errors: /space/azazel/tmp/ruleset.1067161.nft:15:29-38: Error: invalid mapping expression variable quota name ip saddr map $quota_map ~~~~~~~~ ^^^^^^^^^^ Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- src/evaluate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/evaluate.c b/src/evaluate.c index 1682ba58..f28ef2aa 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -4615,8 +4615,9 @@ static int stmt_evaluate_objref_map(struct eval_ctx *ctx, struct stmt *stmt) "Expression is not a map with objects"); 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)) -- 2.33.0
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