Skip to content

Commit 18c18c6

Browse files
MarkWangChinesekartben
authored andcommitted
bluetooth: shell: pairing_accept callback access NULL pointer
pairing_accept callback is called with feat as NULL in the bt_hci_io_capa_req. Signed-off-by: Mark Wang <[email protected]>
1 parent 5e0d3cc commit 18c18c6

File tree

1 file changed

+10
-6
lines changed
  • subsys/bluetooth/host/shell

1 file changed

+10
-6
lines changed

subsys/bluetooth/host/shell/bt.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4217,12 +4217,16 @@ static void auth_pincode_entry(struct bt_conn *conn, bool highsec)
42174217
enum bt_security_err pairing_accept(struct bt_conn *conn,
42184218
const struct bt_conn_pairing_feat *const feat)
42194219
{
4220-
bt_shell_print("Remote pairing features: "
4221-
"IO: 0x%02x, OOB: %d, AUTH: 0x%02x, Key: %d, "
4222-
"Init Kdist: 0x%02x, Resp Kdist: 0x%02x",
4223-
feat->io_capability, feat->oob_data_flag,
4224-
feat->auth_req, feat->max_enc_key_size,
4225-
feat->init_key_dist, feat->resp_key_dist);
4220+
if (feat != NULL) {
4221+
bt_shell_print("Remote pairing features: "
4222+
"IO: 0x%02x, OOB: %d, AUTH: 0x%02x, Key: %d, "
4223+
"Init Kdist: 0x%02x, Resp Kdist: 0x%02x",
4224+
feat->io_capability, feat->oob_data_flag,
4225+
feat->auth_req, feat->max_enc_key_size,
4226+
feat->init_key_dist, feat->resp_key_dist);
4227+
} else {
4228+
bt_shell_print("Remote pairing");
4229+
}
42264230

42274231
return BT_SECURITY_ERR_SUCCESS;
42284232
}

0 commit comments

Comments
 (0)