This is an automated email from Gerrit. "Anatoly P <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9784
-- gerrit commit d6fea09b0bb46c99df70969cea4cd3679ab59d8d Author: Anatoly Parshintsev <[email protected]> Date: Thu Jul 16 02:35:09 2026 +0300 helper/configuration: reject empty filenames in find_file() An empty filename causes find_file() to probe each configured search directory itself. Since fopen() may successfully open a directory for reading, the function can incorrectly return a search directory as the requested file. Change-Id: I3da17a331b24ec3802b0a1f8e73ec6b8e0e863b7 Signed-off-by: Anatoly Parshintsev <[email protected]> diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 447b0dfefa..c2333b4a62 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -66,6 +66,9 @@ char *find_file(const char *file) char const *mode = "r"; char *full_path; + if (!file || strlen(file) == 0) + return NULL; + /* Check absolute and relative to current working dir first. * This keeps full_path reporting belowing working. */ full_path = alloc_printf("%s", file); --
