From: deraadt Date: Mon, 21 Apr 2014 13:13:43 +0000 (+0000) Subject: wrong calloc, see people do care X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=29f63bf363079270225681e35e5212e6cbe34691;p=openbsd wrong calloc, see people do care --- 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; }