From 29f63bf363079270225681e35e5212e6cbe34691 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 21 Apr 2014 13:13:43 +0000 Subject: [PATCH] wrong calloc, see people do care --- lib/libcrypto/bio/bss_dgram.c | 3 ++- lib/libssl/src/crypto/bio/bss_dgram.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/bio/bss_dgram.c b/lib/libcrypto/bio/bss_dgram.c index 72cb19d135f..a3b5bb65746 100644 --- a/lib/libcrypto/bio/bss_dgram.c +++ b/lib/libcrypto/bio/bss_dgram.c @@ -1118,7 +1118,8 @@ dgram_sctp_write(BIO *b, const char *in, int inl) if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) { data->saved_message.bio = b; data->saved_message.length = inl; - data->saved_message.data = calloc(1, inl); + data->saved_message.data = malloc(inl); + memcpy(data->saved_message.data, in, inl); return inl; } diff --git a/lib/libssl/src/crypto/bio/bss_dgram.c b/lib/libssl/src/crypto/bio/bss_dgram.c index 72cb19d135f..a3b5bb65746 100644 --- a/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/lib/libssl/src/crypto/bio/bss_dgram.c @@ -1118,7 +1118,8 @@ dgram_sctp_write(BIO *b, const char *in, int inl) if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) { data->saved_message.bio = b; data->saved_message.length = inl; - data->saved_message.data = calloc(1, inl); + data->saved_message.data = malloc(inl); + memcpy(data->saved_message.data, in, inl); return inl; } -- 2.20.1