From 6628d7a3d9284b39605b61bc57b3766ad3157c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= Date: Tue, 29 Oct 2024 18:46:10 +0100 Subject: [PATCH] utils: check for snprintf truncation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Erik Sjölund --- src/libcrun/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcrun/utils.c b/src/libcrun/utils.c index f15883b41d..a4374739d4 100644 --- a/src/libcrun/utils.c +++ b/src/libcrun/utils.c @@ -1930,7 +1930,7 @@ find_executable (const char *executable_path, const char *cwd) it = "."; len = snprintf (path, PATH_MAX, "%s/%s", it, executable_path); - if (len == PATH_MAX) + if (len >= PATH_MAX) continue; ret = check_access (path);