via: ensure correct buffer size is passed in

This commit is contained in:
Ilya Zhuravlev 2020-12-25 14:29:04 -05:00
parent 5375670000
commit dcf794eb9f

View File

@ -357,13 +357,15 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
case id_dynamic_keymap_macro_get_buffer: {
uint16_t offset = (command_data[0] << 8) | command_data[1];
uint16_t size = command_data[2]; // size <= 28
dynamic_keymap_macro_get_buffer(offset, size, &command_data[3]);
if (size <= 28)
dynamic_keymap_macro_get_buffer(offset, size, &command_data[3]);
break;
}
case id_dynamic_keymap_macro_set_buffer: {
uint16_t offset = (command_data[0] << 8) | command_data[1];
uint16_t size = command_data[2]; // size <= 28
dynamic_keymap_macro_set_buffer(offset, size, &command_data[3]);
if (size <= 28)
dynamic_keymap_macro_set_buffer(offset, size, &command_data[3]);
break;
}
case id_dynamic_keymap_macro_reset: {
@ -377,13 +379,15 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
case id_dynamic_keymap_get_buffer: {
uint16_t offset = (command_data[0] << 8) | command_data[1];
uint16_t size = command_data[2]; // size <= 28
dynamic_keymap_get_buffer(offset, size, &command_data[3]);
if (size <= 28)
dynamic_keymap_get_buffer(offset, size, &command_data[3]);
break;
}
case id_dynamic_keymap_set_buffer: {
uint16_t offset = (command_data[0] << 8) | command_data[1];
uint16_t size = command_data[2]; // size <= 28
dynamic_keymap_set_buffer(offset, size, &command_data[3]);
if (size <= 28)
dynamic_keymap_set_buffer(offset, size, &command_data[3]);
break;
}
case id_eeprom_reset: {