|
@@ -4938,7 +4938,9 @@ static void read_websocket(struct mg_connection *conn)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (header_len > 0) {
|
|
|
+ // TODO: check this !!!
|
|
|
+ // if (header_len > 0) {
|
|
|
+ if (header_len > 0 && body_len >= header_len) {
|
|
|
/* Allocate space to hold websocket payload */
|
|
|
data = mem;
|
|
|
if (data_len > sizeof(mem)) {
|