aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-07-12 00:07:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-07-12 00:08:38 +0200
commitd759a70db88205dd0629d6de602b9b60ede24f2d (patch)
tree10576a593fc1cae1ad7a1030f400096d6e34efaa
parent1dcf4418ba7a0a482c947918645388be2621758a (diff)
SWS: use of uninitialized memory fix
I made "connmon" not get initialized properly before use, and I use the big hammer and make sure we always clear the entire struct to avoid any problem like this in the future.
-rw-r--r--tests/server/sws.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index aaacb3546..b4961a5ed 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -1440,6 +1440,7 @@ static void http_connect(curl_socket_t *infdp,
if(datafd != CURL_SOCKET_BAD) {
struct httprequest req2;
int err;
+ memset(&req2, 0, sizeof(req2));
logmsg("====> Client connect DATA");
#ifdef TCP_NODELAY
/* Disable the Nagle algorithm */
@@ -1699,6 +1700,8 @@ int main(int argc, char *argv[])
bool use_fork = FALSE;
#endif
+ memset(&req, 0, sizeof(req));
+
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("sws IPv4%s"