File tree 1 file changed +4
-4
lines changed
libraries/ESP8266WiFi/src/include
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ class UdpContext
222
222
}
223
223
224
224
bool isValidOffset (const size_t pos) const {
225
- return (pos <= _rx_buf->tot_len );
225
+ return (_rx_buf && pos <= _rx_buf->tot_len );
226
226
}
227
227
228
228
netif* getInputNetif () const
@@ -264,7 +264,7 @@ class UdpContext
264
264
265
265
auto deleteme = _rx_buf;
266
266
267
- while (_rx_buf->len != _rx_buf->tot_len )
267
+ while (_rx_buf->len != _rx_buf->tot_len && _rx_buf-> next )
268
268
_rx_buf = _rx_buf->next ;
269
269
270
270
_rx_buf = _rx_buf->next ;
@@ -292,7 +292,7 @@ class UdpContext
292
292
293
293
// this rx_buf is not nullptr by construction,
294
294
// ref'ing it to prevent release from the below pbuf_free(deleteme)
295
- pbuf_ref (_rx_buf);
295
+ if (_rx_buf) pbuf_ref (_rx_buf);
296
296
}
297
297
pbuf_free (deleteme);
298
298
@@ -466,7 +466,7 @@ class UdpContext
466
466
void _consume (size_t size)
467
467
{
468
468
_rx_buf_offset += size;
469
- if (_rx_buf_offset > _rx_buf->tot_len ) {
469
+ if (_rx_buf && _rx_buf_offset > _rx_buf->tot_len ) {
470
470
_rx_buf_offset = _rx_buf->tot_len ;
471
471
}
472
472
}
You can’t perform that action at this time.
0 commit comments