From 9a428e4c5076c06f4d877bb69efb42197db70841 Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Sun, 12 Nov 2023 15:40:15 +0300 Subject: [PATCH] Fix crash running in restricted environment. When `pwd.h` header is not available (i.e. not using glibc) and environment variables are not set (e.g. running via `env --ignore-environment`) client library would crash due to uninitialized variable in `pa_get_home_dir()`. Add missing initialization to fix that. Fixes: #3792 Part-of: --- src/pulse/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulse/util.c b/src/pulse/util.c index 5933b77e8..c7b828cc2 100644 --- a/src/pulse/util.c +++ b/src/pulse/util.c @@ -167,7 +167,7 @@ char *pa_get_host_name(char *s, size_t l) { char *pa_get_home_dir(char *s, size_t l) { char *e; - char *dir; + char *dir = NULL; #ifdef HAVE_PWD_H struct passwd *r; #endif