diff --git a/Makefile b/Makefile index ec3ebd26..e721d8ae 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto endif -all: mg_prefix unamalgamated unpacked test test++ arm examples vc98 vc2017 mingw mingw++ linux linux++ fuzz +all: mg_prefix unamalgamated unpacked test test++ valgrind arm examples vc98 vc2017 mingw mingw++ linux linux++ fuzz examples: @for X in $(EXAMPLES); do test -f $$X/Makefile || continue; $(MAKE) -C $$X example || exit 1; done diff --git a/mongoose.c b/mongoose.c index 793c3d8a..37cec3da 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3497,6 +3497,7 @@ void mg_connect_resolved(struct mg_connection *c) { static SOCKET raccept(SOCKET sock, union usa *usa, socklen_t len) { SOCKET s = INVALID_SOCKET; do { + memset(usa, 0, sizeof(*usa)); s = accept(sock, &usa->sa, &len); } while (s == INVALID_SOCKET && errno == EINTR); return s; diff --git a/src/sock.c b/src/sock.c index 987b05bc..28e1590b 100644 --- a/src/sock.c +++ b/src/sock.c @@ -361,6 +361,7 @@ void mg_connect_resolved(struct mg_connection *c) { static SOCKET raccept(SOCKET sock, union usa *usa, socklen_t len) { SOCKET s = INVALID_SOCKET; do { + memset(usa, 0, sizeof(*usa)); s = accept(sock, &usa->sa, &len); } while (s == INVALID_SOCKET && errno == EINTR); return s;