From 0bd109c209e04c3a185a66e3078c615abab70f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 23 May 2026 10:48:46 +0200 Subject: [PATCH] fix: bsdl folder error printed uninitialized buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In cmd_autoinit, when find_first_file fails to open ./bsdl_files/ the error path printed `filename` — which is only populated inside the directory-walk loop. Outside that loop it is uninitialized stack content, leading to garbage in the error message (and a confusing diagnostic when bs is launched from a directory without a bsdl_files/ subfolder, e.g. build/). Print `scanfolder` (the actual path that was attempted) instead. Co-Authored-By: Claude Opus 4.7 --- modules/script/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/script/script.c b/modules/script/script.c index c7ddcd0..5bb95c2 100644 --- a/modules/script/script.c +++ b/modules/script/script.c @@ -1571,7 +1571,7 @@ static int cmd_autoinit(script_ctx *ctx, char *line) } else { - ctx->script_printf(ctx, MSG_ERROR, "Can't access the bsdl sub folder ! : %s\n", filename); + ctx->script_printf(ctx, MSG_ERROR, "Can't access the bsdl sub folder ! : %s\n", scanfolder); return JTAG_CORE_ACCESS_ERROR; }