From bd4acbc70e5e224e89f23ac0f8f811af816c8b27 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 5 Dec 2013 23:19:15 +0100 Subject: [PATCH] BIO_new_dgram_sctp, dgram_sctp_read: zero entire authchunks Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- crypto/bio/bss_dgram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 9c0950191b..821320ae23 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -951,7 +951,7 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag) * already, otherwise the connected socket won't use it. */ sockopt_len = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); authchunks = OPENSSL_malloc(sockopt_len); - memset(authchunks, 0, sizeof(sockopt_len)); + memset(authchunks, 0, sockopt_len); ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks, &sockopt_len); OPENSSL_assert(ret >= 0); @@ -1241,7 +1241,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) optlen = (socklen_t)(sizeof(sctp_assoc_t) + 256 * sizeof(uint8_t)); authchunks = OPENSSL_malloc(optlen); - memset(authchunks, 0, sizeof(optlen)); + memset(authchunks, 0, optlen); ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS, authchunks, &optlen); OPENSSL_assert(ii >= 0); -- 2.25.1