Browse Source

Test fix for issue #18 from celeron55

bel 11 years ago
parent
commit
ff72078b45
1 changed files with 3 additions and 1 deletions
  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)) {