From 8019e68f74e68c6dfdf480ca11dc9107ec97ac00 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Thu, 8 Dec 2016 22:51:48 +0100 Subject: [PATCH] Possible buffer overflow correction --- src/classes/Keyboard.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 55a9a9a..eed297e 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -692,16 +692,16 @@ bool Keyboard::setKeys(KeyValue keyValue[], int keyValueCount) { if(keyValue[i].key.addressGroup == KeyAddressGroup::logo && logoCount <= maxLogoKeys) { logo[logoCount] = keyValue[i]; 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]; 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]; 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]; 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]; gkeysCount++; }