浏览代码

Resolve uninitialized variables with MSVC

MSVC says that:

  * civetweb.c(7158): warning C4701: potentially uninitialized local variable 'mask_len'
  * civetweb.c(7147): warning C4701: potentially uninitialized local variable 'data_len'
Matt Clarkson 10 年之前
父节点
当前提交
857d27f918
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -7096,7 +7096,7 @@ static void read_websocket(struct mg_connection *conn,
 	 * len is the length of the current message
 	 * data_len is the length of the current message's data payload
 	 * header_len is the length of the current message's header */
-	size_t i, len, mask_len, data_len, header_len, body_len;
+	size_t i, len, mask_len = 0, data_len = 0, header_len, body_len;
 
 	/* "The masking key is a 32-bit value chosen at random by the client."
 	 * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17#section-5