From 7cb91d35ee5900514c55f95b21a6b4dd4434a493 Mon Sep 17 00:00:00 2001 From: ethan-thompson Date: Tue, 17 Dec 2024 13:37:06 -0500 Subject: [PATCH] fix: When using a dictionary that first defines a protocol with "PROTOCOL" the dctx stack da is updated, but not the filename, causing it to be lost as the stack grows, since all future items on the stack inherit the filename. Fixed by also setting the filename when updating the da. Signed-off-by: ethan-thompson --- src/lib/util/dict_tokenize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index af8209155995..a3d144c50c31 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -169,6 +169,7 @@ static int CC_HINT(nonnull) dict_dctx_push_or_update(dict_tokenize_ctx_t *dctx, fr_dict_attr_t const *da, dict_nest_t nest) { if (dctx->stack[++dctx->stack_depth].nest == nest) { + dctx->stack[dctx->stack_depth].filename = dctx->stack[dctx->stack_depth - 1].filename; dctx->stack[dctx->stack_depth].da = da; return 0; }