From d18fe5c755ab8f78da4279afb8d16e9627e06e91 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Mon, 9 Nov 2026 15:38:03 -0500 Subject: [PATCH] fix(native): the library path given to ld.so holds whole directories only --- tools/nativeguest/hook/paths.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/nativeguest/hook/paths.c b/tools/nativeguest/hook/paths.c index 9f4221e04..8cadb6ecc 100644 --- a/tools/nativeguest/hook/paths.c +++ b/tools/nativeguest/hook/paths.c @@ -579,6 +579,8 @@ static size_t append_rootfs_lib_dirs_missing_from(char *out, size_t outsz, size_ const char *full = rewrite_path_in_root(k_rootfs_lib_dirs[i], buf, sizeof(buf)); size_t n = strlen(full); if (have && have[0] != '\0' && lib_dir_list_has(have, full, n)) continue; + // whole directories only: a cut-off one would be searched in the wrong place + if (used + (separate ? 1 : 0) + n >= outsz) continue; if (separate) used = ddnatv_append(out, outsz, used, ":", 1); separate = 1; used = ddnatv_append(out, outsz, used, full, n);