We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7761ebd commit 328523fCopy full SHA for 328523f
libraries/WiFi/src/WiFiUdp.cpp
@@ -221,9 +221,10 @@ int WiFiUDP::parsePacket(){
221
}
222
remote_ip = IPAddress(si_other.sin_addr.s_addr);
223
remote_port = ntohs(si_other.sin_port);
224
- if (len == 0) return 0;
225
- rx_buffer = new cbuf(len);
226
- rx_buffer->write(buf, len);
+ if (len > 0) {
+ rx_buffer = new cbuf(len);
+ rx_buffer->write(buf, len);
227
+ }
228
delete[] buf;
229
return len;
230
0 commit comments