]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[tls] Fix wrong memset in function tls_clear_cipher
authorStefan Weil <sw@weilnetz.de>
Wed, 4 Apr 2012 16:16:01 +0000 (18:16 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 10 Apr 2012 12:14:15 +0000 (13:14 +0100)
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 <sw@weilnetz.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tls.c

index ce39da9a91b12072e509936c0c3d012f5521689e..0f11fbe2f4e31a482a4ee1874898c223c319e155 100644 (file)
@@ -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;
 }