|
@@ -6839,6 +6839,10 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,
|
|
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
|
|
|
status);
|
|
|
|
|
|
+ if (cp->instance < 1 || cp->instance > HCI_MAX_ADV_INSTANCES)
|
|
|
+ return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
|
|
|
+ MGMT_STATUS_INVALID_PARAMS);
|
|
|
+
|
|
|
flags = __le32_to_cpu(cp->flags);
|
|
|
timeout = __le16_to_cpu(cp->timeout);
|
|
|
duration = __le16_to_cpu(cp->duration);
|