From 1cae1fdbb7fe5637a8b39fd635325c60633aaf00 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Fri, 6 Oct 2023 11:10:53 +0530 Subject: [PATCH] Fix crash if refrence entry not matched --- libbbfdm-api/dmbbf.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libbbfdm-api/dmbbf.c b/libbbfdm-api/dmbbf.c index 893bc9df..34da5a13 100644 --- a/libbbfdm-api/dmbbf.c +++ b/libbbfdm-api/dmbbf.c @@ -2216,6 +2216,17 @@ static int get_key_check_param(DMPARAM_ARGS) char *full_param; char *value = ""; + // Entry not found + if (leaf == NULL) { + dmctx->stop = true; + return 0; + } + + if (DM_STRLEN(leaf->parameter) == 0) { + dmctx->stop = true; + return FAULT_9005; + } + dmastrcat(&full_param, node->current_object, leaf->parameter); if (dm_strcmp_wildcard(dmctx->in_param, full_param) != 0) {