Skip to content

Commit dcccb1f

Browse files
stweilmcb30
authored andcommittedApr 10, 2012
[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 <sw@weilnetz.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
1 parent ede37e4 commit dcccb1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/net/tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static void tls_clear_cipher ( struct tls_session *tls __unused,
594594
cipherspec->pubkey_ctx );
595595
}
596596
free ( cipherspec->dynamic );
597-
memset ( cipherspec, 0, sizeof ( cipherspec ) );
597+
memset ( cipherspec, 0, sizeof ( *cipherspec ) );
598598
cipherspec->suite = &tls_cipher_suite_null;
599599
}
600600

0 commit comments

Comments
 (0)