drop unexpected udp data packet length

This commit is contained in:
Marco Scholl 2024-06-03 10:36:39 +02:00
parent 6eb7af74a0
commit 4f0e47f809
No known key found for this signature in database

View File

@ -517,11 +517,10 @@ int RP2040ArduinoPlatform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
if (len > maxLen) if (len > maxLen)
{ {
print("udp buffer to small. was "); println("Unexpected UDP data packet length - drop packet");
print(maxLen); for (size_t i = 0; i < len; i++)
print(", needed "); _udp.read();
println(len); return 0;
fatalError();
} }
_udp.read(buffer, len); _udp.read(buffer, len);