From: Dr. David von Oheimb Date: Sat, 12 Jun 2021 09:35:09 +0000 (+0200) Subject: fuzz/asn1parse.c: Clean up non-portable code and catch malloc failure X-Git-Tag: openssl-3.0.0-beta1~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f42b3b70d8f2b399e6a0f217bd022f38884343eb;p=thirdparty%2Fopenssl.git fuzz/asn1parse.c: Clean up non-portable code and catch malloc failure Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15722) --- diff --git a/fuzz/asn1parse.c b/fuzz/asn1parse.c index 72b0df8a461..7401375bf07 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);