session: Fix null pointer derefencing
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Mon, 19 Sep 2011 11:50:09 +0000 (13:50 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 22 Sep 2011 13:45:49 +0000 (15:45 +0200)
When an emergency session sets back the EmergencyCall
property, all other session are notified. If a session
previously was not connected (online == FALSE) no
entry (services) was selected. We should not derefency
a NULL pointer in this case.

Fixes BMC#22880

src/session.c

index 45770ed..dd1bc76 100644 (file)
@@ -987,8 +987,10 @@ static void session_changed(struct connman_session *session,
                }
                break;
        case CONNMAN_SESSION_TRIGGER_ECALL:
-               if (info->online == FALSE && info->entry->service != NULL)
+               if (info->online == FALSE && info->entry != NULL &&
+                               info->entry->service != NULL) {
                        test_and_disconnect(session);
+               }
 
                break;
        }