]> code.delx.au - pulseaudio/commitdiff
Fix a NULL pointer access when sutting down esound/simple connections
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Mar 2009 03:00:00 +0000 (04:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 4 Mar 2009 03:00:00 +0000 (04:00 +0100)
If a connection is unlinked make sure the process_msg function doesn't
crash when a message is received afterwards.

Closes #463.

src/pulsecore/protocol-esound.c
src/pulsecore/protocol-simple.c

index cac4e36c7cf3562ab8f7ec9cfc1f9acb61159670..2b80c65ffd6402af5b287eb37c65ddceff52c915 100644 (file)
@@ -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);
index b43245a41bb11e1885c20393d9986fd45cf4e3c1..44fe5973d07cd7b9536a0f3112ce0a989a5d6c9f 100644 (file)
@@ -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);