]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix two seriously wrong memset calls possibly causing crypto connections to fail...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 10 Feb 2012 14:00:18 +0000 (14:00 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 10 Feb 2012 14:00:18 +0000 (14:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11675 d7cf8633-e32d-0410-b094-e92efae38249

crypto.c
netconn.c

index dd7fc885585efcc17ba814697d0f0244a1db251d..30b9bd86ab21cb384c5ffce3415d4e0ef8706829 100644 (file)
--- 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;
 }
 
index f01c3e05264a13b0016737ae1abcad01e3dec9d0..08d7fe408bef23b60a024d9a5fc5aa2d34201c87 100755 (executable)
--- 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));