Skip to content

Commit

Permalink
Check if buffer is the size of a u16 at least before getting it (#1226
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ImUrX authored Nov 3, 2024
1 parent e676a15 commit 662ac1f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ data class UDPPacket15SensorInfo(
sensorType =
IMUType.getById(buf.get().toUInt() and 0xFFu) ?: IMUType.UNKNOWN
}
if (buf.remaining() > 0) {
if (buf.remaining() > 1) {
sensorConfig = SensorConfig(buf.getShort().toUShort())
}
}
Expand Down

0 comments on commit 662ac1f

Please sign in to comment.