소스 검색

Test fix for issue #18 from celeron55

bel 11 년 전
부모
커밋
ff72078b45
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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)) {