mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
Check if environ is actually set before we use it
Some applications seem to set **environ to NULL for various reasons. Before we iterate through it we thus need to make sure it is actually set to make sure we don't segfault. Closes rhbz #473080
This commit is contained in:
parent
2ee9276d97
commit
7013849354
1 changed files with 21 additions and 14 deletions
|
|
@ -44,6 +44,12 @@ void pa_init_proplist(pa_proplist *p) {
|
|||
|
||||
pa_assert(p);
|
||||
|
||||
if (environ) {
|
||||
|
||||
/* Some applications seem to reset environ to NULL for various
|
||||
* reasons, hence we need to check for this explicitly. See
|
||||
* rhbz #473080 */
|
||||
|
||||
for (e = environ; *e; e++) {
|
||||
|
||||
if (pa_startswith(*e, "PULSE_PROP_")) {
|
||||
|
|
@ -67,6 +73,7 @@ void pa_init_proplist(pa_proplist *p) {
|
|||
pa_xfree(k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pa_proplist_contains(p, PA_PROP_APPLICATION_PROCESS_ID)) {
|
||||
char t[32];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue