mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Fix a NULL pointer access when sutting down esound/simple connections
If a connection is unlinked make sure the process_msg function doesn't crash when a message is received afterwards. Closes #463.
This commit is contained in:
parent
869341729f
commit
d09287d211
2 changed files with 6 additions and 0 deletions
|
|
@ -1290,6 +1290,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
|
||||||
connection *c = CONNECTION(o);
|
connection *c = CONNECTION(o);
|
||||||
connection_assert_ref(c);
|
connection_assert_ref(c);
|
||||||
|
|
||||||
|
if (!c->protocol)
|
||||||
|
return -1;
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case CONNECTION_MESSAGE_REQUEST_DATA:
|
case CONNECTION_MESSAGE_REQUEST_DATA:
|
||||||
do_work(c);
|
do_work(c);
|
||||||
|
|
|
||||||
|
|
@ -283,6 +283,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
|
||||||
connection *c = CONNECTION(o);
|
connection *c = CONNECTION(o);
|
||||||
connection_assert_ref(c);
|
connection_assert_ref(c);
|
||||||
|
|
||||||
|
if (!c->protocol)
|
||||||
|
return -1;
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case CONNECTION_MESSAGE_REQUEST_DATA:
|
case CONNECTION_MESSAGE_REQUEST_DATA:
|
||||||
do_work(c);
|
do_work(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue