瀏覽代碼

Merge branch 'master' of https://github.com/civetweb/civetweb

bel2125 5 年之前
父節點
當前提交
187b953077
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      src/civetweb.c
  2. 1 1
      unittest/shared.c

+ 1 - 0
src/civetweb.c

@@ -18886,6 +18886,7 @@ accept_new_connection(const struct socket *listener, struct mg_context *ctx)
 #if !defined(__ZEPHYR__)
 	int on = 1;
 #endif
+	memset(&so, 0, sizeof(so));
 
 	if ((so.sock = accept(listener->sock, &so.rsa.sa, &len))
 	    == INVALID_SOCKET) {

+ 1 - 1
unittest/shared.c

@@ -44,5 +44,5 @@ set_test_directory(const char *const path)
 {
 	strncpy(s_test_directory,
 	        path,
-	        sizeof(s_test_directory) / sizeof(s_test_directory[0]));
+	        sizeof(s_test_directory) - 1);
 }