Browse Source

[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>
tags/v1.20.1
Stefan Weil 12 years ago
parent
commit
dcccb1fb7b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/tls.c

+ 1
- 1
src/net/tls.c View File

@@ -594,7 +594,7 @@ static void tls_clear_cipher ( struct tls_session *tls __unused,
594 594
 			       cipherspec->pubkey_ctx );
595 595
 	}
596 596
 	free ( cipherspec->dynamic );
597
-	memset ( cipherspec, 0, sizeof ( cipherspec ) );
597
+	memset ( cipherspec, 0, sizeof ( *cipherspec ) );
598 598
 	cipherspec->suite = &tls_cipher_suite_null;
599 599
 }
600 600
 

Loading…
Cancel
Save