From 58c894a58d24891eacf7baca0b813a4941cb07aa Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 10 Feb 2012 14:00:18 +0000 Subject: [PATCH] fix two seriously wrong memset calls possibly causing crypto connections to fail, or bogus servers in the server list git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11675 d7cf8633-e32d-0410-b094-e92efae38249 --- crypto.c | 2 +- netconn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto.c b/crypto.c index dd7fc885..30b9bd86 100644 --- a/crypto.c +++ b/crypto.c @@ -545,7 +545,7 @@ qboolean Crypto_ServerFinishInstance(crypto_t *out, crypto_t *crypto) } CLEAR_CDATA; memcpy(out, crypto, sizeof(*out)); - memset(crypto, 0, sizeof(crypto)); + memset(crypto, 0, sizeof(*crypto)); return true; } diff --git a/netconn.c b/netconn.c index f01c3e05..08d7fe40 100755 --- a/netconn.c +++ b/netconn.c @@ -1588,7 +1588,7 @@ static qboolean NetConn_ClientParsePacket_ServerList_PrepareQuery( int protocol, entry = &serverlist_cache[n]; - memset(entry, 0, sizeof(entry)); + memset(entry, 0, sizeof(*entry)); entry->protocol = protocol; // store the data the engine cares about (address and ping) strlcpy (entry->info.cname, ipstring, sizeof(entry->info.cname)); -- 2.39.2