Commit 5d57e796 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Check for valid bdaddr in add_remote_oob_data

Before doing any other verifications, the add_remote_oob_data function
should first check that the given address is valid. This patch adds such
a missing check to the beginning of the function.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent ed93ec69
...@@ -3633,10 +3633,16 @@ static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev, ...@@ -3633,10 +3633,16 @@ static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev,
static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev, static int add_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
void *data, u16 len) void *data, u16 len)
{ {
struct mgmt_addr_info *addr = data;
int err; int err;
BT_DBG("%s ", hdev->name); BT_DBG("%s ", hdev->name);
if (!bdaddr_type_is_valid(addr->type))
return cmd_complete(sk, hdev->id, MGMT_OP_ADD_REMOTE_OOB_DATA,
MGMT_STATUS_INVALID_PARAMS, addr,
sizeof(*addr));
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (len == MGMT_ADD_REMOTE_OOB_DATA_SIZE) { if (len == MGMT_ADD_REMOTE_OOB_DATA_SIZE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment