summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2019-06-27 04:29:35 +0000
committerderaadt <>2019-06-27 04:29:35 +0000
commita9642654a58b0b8243a6e2ab9db9f2a3513713ab (patch)
treea8fbac71642133e0d6b5a3a2a498e84d4bf07436 /src
parent5f388804f2326edf810458c0b1a3880c728a274f (diff)
downloadopenbsd-a9642654a58b0b8243a6e2ab9db9f2a3513713ab.tar.gz
openbsd-a9642654a58b0b8243a6e2ab9db9f2a3513713ab.tar.bz2
openbsd-a9642654a58b0b8243a6e2ab9db9f2a3513713ab.zip
check for asprintf failing allocation
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/base64/base64test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/base64/base64test.c b/src/regress/lib/libcrypto/base64/base64test.c
index d6874d41f8..1ff3b93002 100644
--- a/src/regress/lib/libcrypto/base64/base64test.c
+++ b/src/regress/lib/libcrypto/base64/base64test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: base64test.c,v 1.5 2018/07/17 17:06:49 tb Exp $ */ 1/* $OpenBSD: base64test.c,v 1.6 2019/06/27 04:29:35 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -279,6 +279,9 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl)
279 if (test_nl) 279 if (test_nl)
280 inlen = asprintf(&input, "%s\r\n", bt->out); 280 inlen = asprintf(&input, "%s\r\n", bt->out);
281 281
282 if (inlen == -1)
283 errx(1, "asprintf");
284
282 bio_mem = BIO_new_mem_buf(input, inlen); 285 bio_mem = BIO_new_mem_buf(input, inlen);
283 if (bio_mem == NULL) 286 if (bio_mem == NULL)
284 errx(1, "BIO_new_mem_buf failed"); 287 errx(1, "BIO_new_mem_buf failed");