1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

AndrodGCS: Correctly check HID packet format

This commit is contained in:
James Cotton 2012-08-12 00:30:19 -05:00
parent 5fa36ddd5c
commit 3d34a5d280

View File

@ -500,7 +500,7 @@ public class HidUAVTalk extends TelemetryTask {
//Assert.assertEquals(1, buffer.get()); // Report ID
//Assert.assertTrue(dataSize < buffer.capacity());
if (buffer.get(0) != 1 || buffer.get(1) < 0 || buffer.get(2) > (buffer.capacity() - 2)) {
if (buffer.get(0) != 1 || buffer.get(1) < 0 || buffer.get(1) > (buffer.capacity() - 2)) {
if (DEBUG) Log.d(TAG, "Badly formatted HID packet");
} else {
byte[] dst = new byte[dataSize];