You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/01/27 06:12:45 UTC

[07/10] incubator-mynewt-larva git commit: Fix null pointer dereference bug in host.

Fix null pointer dereference bug in host.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6271de76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6271de76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6271de76

Branch: refs/heads/master
Commit: 6271de76b62c5d192cc5bc825c694c00a2329064
Parents: e52545c
Author: Christopher Collins <cc...@gmail.com>
Authored: Tue Jan 26 21:13:15 2016 -0500
Committer: Christopher Collins <cc...@gmail.com>
Committed: Wed Jan 27 00:12:02 2016 -0500

----------------------------------------------------------------------
 net/nimble/host/src/ble_gap_conn.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6271de76/net/nimble/host/src/ble_gap_conn.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap_conn.c b/net/nimble/host/src/ble_gap_conn.c
index 2208758..7d51bf7 100644
--- a/net/nimble/host/src/ble_gap_conn.c
+++ b/net/nimble/host/src/ble_gap_conn.c
@@ -1971,8 +1971,10 @@ err:
     neg_reply.handle = evt->connection_handle;
     neg_reply.reason = rc;
 
-    entry->state = BLE_GAP_CONN_STATE_U_NEG_REPLY;
-    ble_hci_ack_set_callback(ble_gap_conn_param_neg_reply_ack, entry);
+    if (entry != NULL) {
+        entry->state = BLE_GAP_CONN_STATE_U_NEG_REPLY;
+        ble_hci_ack_set_callback(ble_gap_conn_param_neg_reply_ack, entry);
+    }
 
     host_hci_cmd_le_conn_param_neg_reply(&neg_reply);
 }