genesys: Fix out of bounds access during calibration on gl843

merge-requests/407/head
Povilas Kanapickas 2020-04-15 00:15:10 +03:00
rodzic ea7f8a58f2
commit 7304a4bb78
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -2005,6 +2005,9 @@ void CommandSetGl843::send_shading_data(Genesys_Device* dev, const Genesys_Senso
length -= (-offset);
offset = 0;
}
if (static_cast<int>(length) + offset > static_cast<int>(size)) {
length = size - offset;
}
/* loop over calibration data */
for (i = 0; i < length; i++)