Explorar el Código

[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 hace 12 años
padre
commit
dcccb1fb7b
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      src/net/tls.c

+ 1
- 1
src/net/tls.c Ver fichero

@@ -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…
Cancelar
Guardar