diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-03-04 04:00:00 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-03-04 04:00:00 +0100 |
commit | d09287d211164a93bcbb66839998fc64bad746ce (patch) | |
tree | 251a7452d009fa5d894957766f2a547686205890 | |
parent | 869341729f088f3ec19c39aae5565cfae7f7ea33 (diff) |
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.
-rw-r--r-- | src/pulsecore/protocol-esound.c | 3 | ||||
-rw-r--r-- | src/pulsecore/protocol-simple.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c index cac4e36c..2b80c65f 100644 --- a/src/pulsecore/protocol-esound.c +++ b/src/pulsecore/protocol-esound.c @@ -1290,6 +1290,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6 connection *c = CONNECTION(o); connection_assert_ref(c); + if (!c->protocol) + return -1; + switch (code) { case CONNECTION_MESSAGE_REQUEST_DATA: do_work(c); diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c index b43245a4..44fe5973 100644 --- a/src/pulsecore/protocol-simple.c +++ b/src/pulsecore/protocol-simple.c @@ -283,6 +283,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6 connection *c = CONNECTION(o); connection_assert_ref(c); + if (!c->protocol) + return -1; + switch (code) { case CONNECTION_MESSAGE_REQUEST_DATA: do_work(c); |