diff options
author | 2019-06-27 04:29:35 +0000 | |
---|---|---|
committer | 2019-06-27 04:29:35 +0000 | |
commit | fe8a344b967cf5111ea707d47526ca78a4e9ac7d (patch) | |
tree | ab1fb0ba14a66e00eb23802af3c8ad3262df5d4a | |
parent | an -> a; (diff) | |
download | wireguard-openbsd-fe8a344b967cf5111ea707d47526ca78a4e9ac7d.tar.xz wireguard-openbsd-fe8a344b967cf5111ea707d47526ca78a4e9ac7d.zip |
check for asprintf failing allocation
-rw-r--r-- | regress/lib/libcrypto/base64/base64test.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/regress/lib/libcrypto/base64/base64test.c b/regress/lib/libcrypto/base64/base64test.c index d6874d41f84..1ff3b930023 100644 --- a/regress/lib/libcrypto/base64/base64test.c +++ b/regress/lib/libcrypto/base64/base64test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64test.c,v 1.5 2018/07/17 17:06:49 tb Exp $ */ +/* $OpenBSD: base64test.c,v 1.6 2019/06/27 04:29:35 deraadt Exp $ */ /* * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> * @@ -279,6 +279,9 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl) if (test_nl) inlen = asprintf(&input, "%s\r\n", bt->out); + if (inlen == -1) + errx(1, "asprintf"); + bio_mem = BIO_new_mem_buf(input, inlen); if (bio_mem == NULL) errx(1, "BIO_new_mem_buf failed"); |