Procházet zdrojové kódy

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

bel2125 před 5 roky
rodič
revize
187b953077
2 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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);
 }