david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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>
This commit is contained in:
Stefan Weil 2012-04-04 18:16:01 +02:00 committed by Michael Brown
parent ede37e493d
commit dcccb1fb7b
1 changed files with 1 additions and 1 deletions

View 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;
}