util: added to the NULL check. 25/148425/2
authorSegwon <segwon.han@samsung.com>
Fri, 8 Sep 2017 02:07:25 +0000 (11:07 +0900)
committerSegwon Han <segwon.han@samsung.com>
Fri, 8 Sep 2017 02:12:13 +0000 (02:12 +0000)
 - SVACE : 279879, DEREF_OF_NULL.RET.PROC.STAT

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I0ac9861b1afabc52ccd29c125f245414688d7c1c

src/daemon/peripheral_bus_util.c

index aaad11d..7fcc4b6 100644 (file)
@@ -109,6 +109,11 @@ int peripheral_bus_get_client_info(
        const gchar *id;
 
        id = g_dbus_method_invocation_get_sender(invocation);
+       if (id == NULL) {
+               _E("Current id is NULL");
+               return -1;
+       }
+
        _ret = g_dbus_connection_call_sync(pb_data->connection,
                "org.freedesktop.DBus",
                "/org/freedesktop/DBus",
@@ -151,6 +156,11 @@ int peripheral_bus_handle_is_valid(
        }
 
        id = g_dbus_method_invocation_get_sender(invocation);
+       if (id == NULL) {
+               _E("Current id is NULL");
+               return -1;
+       }
+
        if (strcmp(handle->client_info.id, id)) {
                _E("Invalid access, handle id : %s, current id : %s", handle->client_info.id, id);
                return -1;