From 61b0fe617e51877bb51a86d6e01b78db435029da Mon Sep 17 00:00:00 2001 From: Guilhem Bryant Date: Fri, 27 Mar 2020 11:12:12 +0000 Subject: [PATCH] Initialise psk_len in mbedtls_ssl_psk_derive_premaster() Signed-off-by: Guilhem Bryant --- library/ssl_tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 8dbae7aaa..6dabd3409 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1849,7 +1849,7 @@ int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exch unsigned char *p = ssl->handshake->premaster; unsigned char *end = p + sizeof( ssl->handshake->premaster ); const unsigned char *psk; - size_t psk_len; + size_t psk_len = 0; if( mbedtls_ssl_get_psk( ssl, &psk, &psk_len ) == MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED )