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: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/800>
This commit is contained in:
Igor V. Kovalenko 2023-11-12 15:40:15 +03:00
parent 06ccfbb996
commit 81a6cc4967

View file

@ -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