Fix a potential information leak in cipher.c.
authorJulia Lawall <julia@diku.dk>
Fri, 04 Feb 2011 01:38:51 +0000
changeset8c850977cb42 pushlog
parent 9b94ffdfae68
child 61510f440ffe
Fix a potential information leak in cipher.c.


committer: John Bailey <rekkanoryo@rekkanoryo.org>
libpurple/cipher.c
     1.1 --- a/libpurple/cipher.c
     1.2 +++ b/libpurple/cipher.c
     1.3 @@ -249,7 +249,7 @@
     1.4  	purple_cipher_context_reset(context, NULL);
     1.5  
     1.6  	md5_context = purple_cipher_context_get_data(context);
     1.7 -	memset(md5_context, 0, sizeof(md5_context));
     1.8 +	memset(md5_context, 0, sizeof(*md5_context));
     1.9  
    1.10  	g_free(md5_context);
    1.11  	md5_context = NULL;
    1.12 @@ -705,7 +705,7 @@
    1.13  	purple_cipher_context_reset(context, NULL);
    1.14  
    1.15  	md4_context = purple_cipher_context_get_data(context);
    1.16 -	memset(md4_context, 0, sizeof(md4_context));
    1.17 +	memset(md4_context, 0, sizeof(*md4_context));
    1.18  
    1.19  	g_free(md4_context);
    1.20  	md4_context = NULL;
    1.21 @@ -1356,7 +1356,7 @@
    1.22  	struct _des_ctx *des_context;
    1.23  
    1.24  	des_context = purple_cipher_context_get_data(context);
    1.25 -	memset(des_context, 0, sizeof(des_context));
    1.26 +	memset(des_context, 0, sizeof(*des_context));
    1.27  
    1.28  	g_free(des_context);
    1.29  	des_context = NULL;
    1.30 @@ -1706,7 +1706,7 @@
    1.31  	struct _des3_ctx *des3_context;
    1.32  
    1.33  	des3_context = purple_cipher_context_get_data(context);
    1.34 -	memset(des3_context, 0, sizeof(des3_context));
    1.35 +	memset(des3_context, 0, sizeof(*des3_context));
    1.36  
    1.37  	g_free(des3_context);
    1.38  	des3_context = NULL;
    1.39 @@ -2382,7 +2382,7 @@
    1.40  	struct RC4Context *rc4_ctx;
    1.41  
    1.42  	rc4_ctx = purple_cipher_context_get_data(context);
    1.43 -	memset(rc4_ctx, 0, sizeof(rc4_ctx));
    1.44 +	memset(rc4_ctx, 0, sizeof(*rc4_ctx));
    1.45  
    1.46  	g_free(rc4_ctx);
    1.47  	rc4_ctx = NULL;
    1.48 @@ -2828,7 +2828,7 @@
    1.49  	if(cipher->ops && cipher->ops->uninit)
    1.50  		cipher->ops->uninit(context);
    1.51  
    1.52 -	memset(context, 0, sizeof(context));
    1.53 +	memset(context, 0, sizeof(*context));
    1.54  	g_free(context);
    1.55  	context = NULL;
    1.56  }