summaryrefslogtreecommitdiff
path: root/fuzz
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-06-12 11:35:09 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-06-15 14:23:29 +0200
commitf42b3b70d8f2b399e6a0f217bd022f38884343eb (patch)
treed201cd89e2a2595b61646389b3601e99ad293c2c /fuzz
parent9d9691f78a67fed1b30b0cf84b2f3601897b9639 (diff)
downloadopenssl-new-f42b3b70d8f2b399e6a0f217bd022f38884343eb.tar.gz
fuzz/asn1parse.c: Clean up non-portable code and catch malloc failure
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15722)
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/asn1parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fuzz/asn1parse.c b/fuzz/asn1parse.c
index 72b0df8a46..7401375bf0 100644
--- a/fuzz/asn1parse.c
+++ b/fuzz/asn1parse.c
@@ -23,9 +23,9 @@ static BIO *bio_out;
int FuzzerInitialize(int *argc, char ***argv)
{
- bio_out = BIO_new_file("/dev/null", "w");
+ bio_out = BIO_new(BIO_s_null()); /* output will be ignored */
if (bio_out == NULL)
- bio_out = BIO_new(BIO_s_mem());
+ return 0;
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
ERR_clear_error();
CRYPTO_free_ex_index(0, -1);