Explorar o código

Test fix for issue #18 from celeron55

bel %!s(int64=11) %!d(string=hai) anos
pai
achega
ff72078b45
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/civetweb.c

+ 3 - 1
src/civetweb.c

@@ -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)) {