From dcccb1fb7bb79bdd018b23ca203d26cca98a1d3f Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 4 Apr 2012 18:16:01 +0200 Subject: [PATCH] [tls] Fix wrong memset in function tls_clear_cipher sizeof(cipherspec) is obviously wrong in this context, because it will only zero the first 4 or 8 bytes (cipherspec is a pointer). This problem was reported by cppcheck. Signed-off-by: Stefan Weil Signed-off-by: Michael Brown --- src/net/tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tls.c b/src/net/tls.c index ce39da9a..0f11fbe2 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -594,7 +594,7 @@ static void tls_clear_cipher ( struct tls_session *tls __unused, cipherspec->pubkey_ctx ); } free ( cipherspec->dynamic ); - memset ( cipherspec, 0, sizeof ( cipherspec ) ); + memset ( cipherspec, 0, sizeof ( *cipherspec ) ); cipherspec->suite = &tls_cipher_suite_null; }