From 22be888daeae2731bc4857d3bedf25b9b0621ac5 Mon Sep 17 00:00:00 2001 From: mitmitmitm Date: Mon, 20 Feb 2023 11:03:38 +0100 Subject: [PATCH] Don't left-shift by negative amount, which is UB according to C17 --- src/upf/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upf/context.c b/src/upf/context.c index 4644c20e9..92bdc1418 100644 --- a/src/upf/context.c +++ b/src/upf/context.c @@ -534,7 +534,7 @@ static void add_framed_route_to_trie(ogs_ipsubnet_t *route, upf_sess_t *sess) for (i = 0; i <= nbits; i++) { int part = i / chunk_size; - int bit = (- i - 1) % chunk_size; + int bit = (nbits - i - 1) % chunk_size; if (!*trie) *trie = ogs_calloc(1, sizeof(**trie));