wrong calloc, see people do care
authorderaadt <deraadt@openbsd.org>
Mon, 21 Apr 2014 13:13:43 +0000 (13:13 +0000)
committerderaadt <deraadt@openbsd.org>
Mon, 21 Apr 2014 13:13:43 +0000 (13:13 +0000)
lib/libcrypto/bio/bss_dgram.c
lib/libssl/src/crypto/bio/bss_dgram.c

index 72cb19d..a3b5bb6 100644 (file)
@@ -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;
        }
 
index 72cb19d..a3b5bb6 100644 (file)
@@ -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;
        }