Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
stweil authored and mcb30 committed Apr 10, 2012
1 parent ede37e4 commit dcccb1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/tls.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit dcccb1f

Please sign in to comment.