Skip to content

Commit

Permalink
udp realtime - improve robustness against short packets (fix for Airc…
Browse files Browse the repository at this point in the history
…oookie#3672)

when only two bytes were received in a packet, the "for" condition `packetsize -3` would underflow, leading to an infinite loop.
  • Loading branch information
softhack007 authored and JPZV committed Jan 18, 2024
1 parent 4b60428 commit a95496b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wled00/udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void handleNotifications()

id++; if (id >= totalLen) break;
}
} else if (udpIn[0] == 3 && packetSize > 6) //drgbw
} else if (udpIn[0] == 3) //drgbw
{
uint16_t id = 0;
for (size_t i = 2; i < packetSize -3; i += 4)
Expand Down

0 comments on commit a95496b

Please sign in to comment.