Return invalid parameters error if reserved value is used. --- emulator/btdev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 2a0c673..a2a2e50 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -2393,8 +2393,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, case BT_HCI_CMD_SET_HOST_FLOW_CONTROL: shfc = data; - btdev->host_flow_control = shfc->enable; - status = BT_HCI_ERR_SUCCESS; + if (shfc->enable > 0x03) { + status = BT_HCI_ERR_INVALID_PARAMETERS; + } else { + btdev->host_flow_control = shfc->enable; + status = BT_HCI_ERR_SUCCESS; + } cmd_complete(btdev, opcode, &status, sizeof(status)); break; -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html