From: Adrien Gallouët Date: Thu, 30 Apr 2026 19:32:41 +0000 (+0200) Subject: common : check for null getpwuid in hf-cache (#22550) X-Git-Tag: upstream/0.0.10438~1447 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=beb42fffa45eded44804a1fd4916146222371581;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : check for null getpwuid in hf-cache (#22550) Signed-off-by: Adrien Gallouët --- diff --git a/common/hf-cache.cpp b/common/hf-cache.cpp index ea5b2150d..20f33e4c7 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