[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] zeroconf-publish: Fix crash when avahi_client_new() fails

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Thu May 26 16:45:38 UTC 2022



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
65889fbd by Georg Chini at 2022-05-26T16:41:21+00:00
zeroconf-publish: Fix crash when avahi_client_new() fails

When the module is loaded and avahi_client_new() fails because the client cannot
connect, a shutdown of the module is scheduled. In parallel, the client_callback
is called with AVAHI_ERR_DISCONNECTED and another connection attempt is made
which also fails and triggers a second unload of the module. This crashes PA,
because there is already an unload in progress.
This patch fixes the problem by checking if an unload is already scheduled.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/710>

- - - - -


1 changed file:

- src/modules/module-zeroconf-publish.c


Changes:

=====================================
src/modules/module-zeroconf-publish.c
=====================================
@@ -645,7 +645,7 @@ static int avahi_process_msg(pa_msgobject *o, int code, void *data, int64_t offs
 
     pa_assert(u);
 
-    if (u->shutting_down)
+    if (u->shutting_down || u->module->unload_requested)
         return 0;
 
     switch (code) {



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/65889fbdee15c7a664670540f59e8f3c5c20c640

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/65889fbdee15c7a664670540f59e8f3c5c20c640
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20220526/cce61012/attachment-0001.htm>


More information about the pulseaudio-commits mailing list