diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-05 23:19:15 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-08-15 22:37:28 +0200 |
commit | bd4acbc70e5e224e89f23ac0f8f811af816c8b27 (patch) | |
tree | 2372921ba052e02a2997fe622cd2fe38e73bd418 | |
parent | 89572788695c67e966f78ea481000bd32fe29fbf (diff) |
BIO_new_dgram_sctp, dgram_sctp_read: zero entire authchunks
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r-- | crypto/bio/bss_dgram.c | 4 |
1 files 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); |