From 9c7954945fdb57429a51b96717ca0227210a16ee Mon Sep 17 00:00:00 2001 From: Roberto Viola Date: Tue, 24 Dec 2024 12:30:50 +0100 Subject: [PATCH] Update kineticinroadbike.cpp --- src/devices/kineticinroadbike/kineticinroadbike.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/devices/kineticinroadbike/kineticinroadbike.cpp b/src/devices/kineticinroadbike/kineticinroadbike.cpp index 8c4e4eb25..0cd477394 100644 --- a/src/devices/kineticinroadbike/kineticinroadbike.cpp +++ b/src/devices/kineticinroadbike/kineticinroadbike.cpp @@ -197,6 +197,11 @@ void kineticinroadbike::characteristicChanged(const QLowEnergyCharacteristic &ch QByteArray encryptedData = newValue; int dataSize = encryptedData.size(); + if (dataSize < 14 || characteristic.uuid() != QBluetoothUuid(QStringLiteral("e9410201-b434-446b-b5cc-36592fc4c724"))) { + qDebug() << "Invalid data size"; + return; + } + smart_control_power_data pD = smart_control_process_power_data((uint8_t *)newValue.data(), dataSize); // Set the parsed values to the bike metrics