Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83912c82 authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Bluetooth: Prevent gatt DB copy if server cache is absent

In case the server cache does not exist for a specific
connection, the API used to copy the server DB into the
DB structure needs to return immediately. This change
makes sure of that and prevents dereferencing of a null
block causing the runtime error.

Change-Id: Iec3040a1280ef9d80b1b9c76eca8071dff499411
parent 439066db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1330,6 +1330,7 @@ void bta_gattc_get_gatt_db(uint16_t conn_id, uint16_t start_handle, uint16_t end
    if (!p_clcb->p_srcb || p_clcb->p_srcb->p_srvc_list || /* no active discovery */
        !p_clcb->p_srcb->p_srvc_cache) {
        APPL_TRACE_ERROR("No server cache available");
        return;
    }

    bta_gattc_get_gatt_db_impl(p_clcb->p_srcb, start_handle, end_handle, db, count);