Explorar o código

Merge pull request #130 from hansipie/master

assert if pointer is NULL
bel2125 %!s(int64=10) %!d(string=hai) anos
pai
achega
e994488947
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/civetweb.c

+ 4 - 0
src/civetweb.c

@@ -1443,6 +1443,10 @@ static void sockaddr_to_string(char *buf, size_t len, const union usa *usa)
 {
 	buf[0] = '\0';
 
+	if (!usa) {
+		return;
+	}
+	
 	if (usa->sa.sa_family == AF_INET) {
 		getnameinfo(
 		    &usa->sa, sizeof(usa->sin), buf, len, NULL, 0, NI_NUMERICHOST);