From 34e81deda3bcd23e82ef3c74434d44518eaf5bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Thu, 30 Apr 2026 12:04:30 +0000 Subject: [PATCH] common : check for null getpwuid in hf-cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- common/hf-cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/hf-cache.cpp b/common/hf-cache.cpp index ea5b2150de4..20f33e4c7f4 100644 --- a/common/hf-cache.cpp +++ b/common/hf-cache.cpp @@ -57,7 +57,7 @@ static fs::path get_cache_directory() { #ifndef _WIN32 const struct passwd * pw = getpwuid(getuid()); - if (pw->pw_dir && *pw->pw_dir) { + if (pw && pw->pw_dir && *pw->pw_dir) { return fs::path(pw->pw_dir) / ".cache" / "huggingface" / "hub"; } #endif