Commit 7751dc1f authored by Juergen Lock's avatar Juergen Lock Committed by Rémi Denis-Courmont

PulseAudio: fix segmentation fault

Reported by: Rainer Hurling
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 384062b8
......@@ -123,10 +123,13 @@ pa_context *vlc_pa_connect (vlc_object_t *obj, pa_threaded_mainloop **mlp)
struct passwd pwbuf, *pw;
char buf[len];
if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0
&& pw != NULL)
pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
pw->pw_name);
if (getpwuid_r (getuid (), &pwbuf, buf, sizeof (buf), &pw) == 0)
{
if (pw != NULL)
pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_USER,
pw->pw_name);
break;
}
}
for (size_t max = sysconf (_SC_HOST_NAME_MAX), len = max % 1024 + 1024;
......@@ -135,8 +138,11 @@ pa_context *vlc_pa_connect (vlc_object_t *obj, pa_threaded_mainloop **mlp)
char hostname[len];
if (gethostname (hostname, sizeof (hostname)) == 0)
{
pa_proplist_sets (props, PA_PROP_APPLICATION_PROCESS_HOST,
hostname);
break;
}
}
const char *session = getenv ("XDG_SESSION_COOKIE");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment