summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-12-22 11:23:00 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-02 11:55:18 +0100
commit43b2ccbcdcf780c09f0177c635e95d14a1e765ae (patch)
tree72d5088569272013d80f2dd4b79974cfee288fa8 /src/evaluate.c
parent4b2415efa9eb2119411f7402cd08480f4b8ccb90 (diff)
evaluate: fix shift exponent underflow in concatenation evaluation
commit 0fe79458cb5ae36d838f0e5a5dc5cc6f332cac03 upstream. There is an underflow of the index that iterates over the concatenation: ../include/datatype.h:292:15: runtime error: shift exponent 4294967290 is too large for 32-bit type 'unsigned int' set the datatype to invalid which is fine to evaluate a concatenation in a set/map statement. Update b8e1940aa190 ("tests: add a test case for map update from packet path with concat") so it does not need a workaround to work. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index c04cb91d..70adb847 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1357,7 +1357,7 @@ static int expr_evaluate_concat(struct eval_ctx *ctx, struct expr **expr)
dsize = key->len;
bo = key->byteorder;
off--;
- } else if (dtype == NULL) {
+ } else if (dtype == NULL || off == 0) {
tmp = datatype_lookup(TYPE_INVALID);
} else {
tmp = concat_subtype_lookup(type, --off);