summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ecdsatest.c4
-rw-r--r--test/ssltest.c7
2 files changed, 3 insertions, 8 deletions
diff --git a/test/ecdsatest.c b/test/ecdsatest.c
index 377e2c5367..4b6d0444bf 100644
--- a/test/ecdsatest.c
+++ b/test/ecdsatest.c
@@ -440,10 +440,8 @@ int test_builtin(BIO *out)
goto builtin_err;
}
buf_len = 2 * bn_len;
- if ((raw_buf = OPENSSL_malloc(buf_len)) == NULL)
+ if ((raw_buf = OPENSSL_zalloc(buf_len)) == NULL)
goto builtin_err;
- /* Pad the bignums with leading zeroes. */
- memset(raw_buf, 0, buf_len);
BN_bn2bin(ecdsa_sig->r, raw_buf + bn_len - r_len);
BN_bn2bin(ecdsa_sig->s, raw_buf + buf_len - s_len);
diff --git a/test/ssltest.c b/test/ssltest.c
index 914419109d..adf1368020 100644
--- a/test/ssltest.c
+++ b/test/ssltest.c
@@ -2116,14 +2116,11 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
bufsiz = count > 40 * 1024 ? 40 * 1024 : count;
- if ((cbuf = OPENSSL_malloc(bufsiz)) == NULL)
+ if ((cbuf = OPENSSL_zalloc(bufsiz)) == NULL)
goto err;
- if ((sbuf = OPENSSL_malloc(bufsiz)) == NULL)
+ if ((sbuf = OPENSSL_zalloc(bufsiz)) == NULL)
goto err;
- memset(cbuf, 0, bufsiz);
- memset(sbuf, 0, bufsiz);
-
c_to_s = BIO_new(BIO_s_mem());
s_to_c = BIO_new(BIO_s_mem());
if ((s_to_c == NULL) || (c_to_s == NULL)) {