ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

Segfault / sentinel

Open dirkx opened this issue 1 year ago • 0 comments

During a congested network - I got reproducable segaults in:

https://github.com/me-no-dev/ESPAsyncWebServer/blob/67de9cddbbf0d024c61a314bacd204ba6101fac8/src/AsyncWebSocket.cpp#L646

it appears that data can be NULL (and datalen = 0). Given that in line

https://github.com/me-no-dev/ESPAsyncWebServer/blob/67de9cddbbf0d024c61a314bacd204ba6101fac8/src/AsyncWebSocket.cpp#L698

this is only used when datalen >0 I suggest putting an

 uint8_t datalast;
 if (data && datalen>0)  datalast = data[datalen];

sentinel in.

dirkx avatar Dec 31 '24 12:12 dirkx