1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 09:16:11 +00:00

Possible buffer overflow correction

This commit is contained in:
MatMoul 2016-12-08 22:51:48 +01:00
parent 3af149101e
commit 8019e68f74

View File

@ -692,16 +692,16 @@ bool Keyboard::setKeys(KeyValue keyValue[], int keyValueCount) {
if(keyValue[i].key.addressGroup == KeyAddressGroup::logo && logoCount <= maxLogoKeys) { if(keyValue[i].key.addressGroup == KeyAddressGroup::logo && logoCount <= maxLogoKeys) {
logo[logoCount] = keyValue[i]; logo[logoCount] = keyValue[i];
logoCount++; logoCount++;
} else if(keyValue[i].key.addressGroup == KeyAddressGroup::indicators && logoCount <= maxIndicatorsKeys) { } else if(keyValue[i].key.addressGroup == KeyAddressGroup::indicators && indicatorsCount <= maxIndicatorsKeys) {
indicators[indicatorsCount] = keyValue[i]; indicators[indicatorsCount] = keyValue[i];
indicatorsCount++; indicatorsCount++;
} else if(keyValue[i].key.addressGroup == KeyAddressGroup::multimedia && logoCount <= maxMultimediaKeys) { } else if(keyValue[i].key.addressGroup == KeyAddressGroup::multimedia && multimediaCount <= maxMultimediaKeys) {
multimedia[multimediaCount] = keyValue[i]; multimedia[multimediaCount] = keyValue[i];
multimediaCount++; multimediaCount++;
} else if(keyValue[i].key.addressGroup == KeyAddressGroup::keys && logoCount <= maxKeys) { } else if(keyValue[i].key.addressGroup == KeyAddressGroup::keys && keysCount <= maxKeys) {
keys[keysCount] = keyValue[i]; keys[keysCount] = keyValue[i];
keysCount++; keysCount++;
} else if(keyValue[i].key.addressGroup == KeyAddressGroup::gkeys && logoCount <= maxGKeys) { } else if(keyValue[i].key.addressGroup == KeyAddressGroup::gkeys && gkeysCount <= maxGKeys) {
gkeys[gkeysCount] = keyValue[i]; gkeys[gkeysCount] = keyValue[i];
gkeysCount++; gkeysCount++;
} }