You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2020/01/03 10:08:32 UTC

[mynewt-nimble] branch master updated: nimble/gatt: Fix null pointer dereference

This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e7c1d5  nimble/gatt: Fix null pointer dereference
6e7c1d5 is described below

commit 6e7c1d5d97ef02fda9919d4e83d407ac64cd26f9
Author: Mohamed Essayed <mo...@synopsys.com>
AuthorDate: Thu Sep 5 20:40:31 2019 +0200

    nimble/gatt: Fix null pointer dereference
    
    Modify ble_gattc_proc_matches_conn_rx_entry to return 0 in case
    no matching entry was found. Otherwise null pointer deference
    might happen.
---
 nimble/host/src/ble_gattc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/host/src/ble_gattc.c b/nimble/host/src/ble_gattc.c
index c3ff060..a6e114c 100644
--- a/nimble/host/src/ble_gattc.c
+++ b/nimble/host/src/ble_gattc.c
@@ -912,7 +912,7 @@ ble_gattc_proc_matches_conn_rx_entry(struct ble_gattc_proc *proc, void *arg)
     criteria->matching_rx_entry = ble_gattc_rx_entry_find(
         proc->op, criteria->rx_entries, criteria->num_rx_entries);
 
-    return 1;
+    return (criteria->matching_rx_entry != NULL);
 }
 
 static void