Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 80ed11d38 -> 311154e77


nimble/sm: Fix out of bound access with logs enabled

TK is 16 bytes long.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/98f2a201
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/98f2a201
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/98f2a201

Branch: refs/heads/develop
Commit: 98f2a20120ebd397f6e1cf14a16ec35e65936fe0
Parents: 876af60
Author: Szymon Janc <[email protected]>
Authored: Mon Jan 30 16:06:06 2017 +0100
Committer: Szymon Janc <[email protected]>
Committed: Mon Jan 30 16:08:03 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/98f2a201/net/nimble/host/src/ble_sm_sc.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm_sc.c b/net/nimble/host/src/ble_sm_sc.c
index 32806b0..b751a0b 100644
--- a/net/nimble/host/src/ble_sm_sc.c
+++ b/net/nimble/host/src/ble_sm_sc.c
@@ -429,7 +429,7 @@ ble_sm_sc_random_rx(struct ble_sm_proc *proc, struct 
ble_sm_result *res)
         ble_sm_sc_responder_verifies_random(proc)) {
 
         BLE_HS_LOG(DEBUG, "tk=");
-        ble_hs_log_flat_buf(proc->tk, 32);
+        ble_hs_log_flat_buf(proc->tk, 16);
         BLE_HS_LOG(DEBUG, "\n");
 
         rc = ble_sm_alg_f4(proc->pub_key_peer.x, ble_sm_sc_pub_key.u8,
@@ -720,7 +720,7 @@ ble_sm_dhkey_check_process(struct ble_sm_proc *proc,
                           &peer_id_addr_type,
                           &peer_ota_addr);
     BLE_HS_LOG(DEBUG, "tk=");
-    ble_hs_log_flat_buf(proc->tk, 32);
+    ble_hs_log_flat_buf(proc->tk, 16);
     BLE_HS_LOG(DEBUG, "\n");
 
     res->app_status = ble_sm_alg_f6(proc->mackey,

Reply via email to