Fix PXX2 telemetry

This commit is contained in:
Raphael Coeffic
2022-08-11 12:15:46 +02:00
committed by Raphael Coeffic
parent df0d115a72
commit e31e3bb8be
2 changed files with 7 additions and 10 deletions
+6 -2
View File
@@ -752,9 +752,13 @@ static void pxx2ProcessData(void* context, uint8_t data, uint8_t* buffer, uint8_
*len = 0;
}
// no size yet
if (*len < 2) return;
uint8_t frame_len = buffer[1];
/* 1 byte start + 2 bytes header + 2 bytes CRC = 5 */
if (*len < unsigned(frame_len + 5)) {
/* 1 byte start + 1 byte len + 2 bytes CRC = 4 */
if (*len < unsigned(frame_len + 4)) {
return;
}