X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=fuzz%2Fasn1parse.c;h=3e11d350c1b68d5f1600cc7a100b742a36c779df;hp=edb4d023030273f199208a4645a4c832b38e0a11;hb=da15cb7cd99be8dac3d28f78a0cf97437e9f5fac;hpb=ad4da7fbc0779fb1730c9862221e19583de69f4f diff --git a/fuzz/asn1parse.c b/fuzz/asn1parse.c index edb4d02303..3e11d350c1 100644 --- a/fuzz/asn1parse.c +++ b/fuzz/asn1parse.c @@ -18,22 +18,21 @@ #include #include "fuzzer.h" +static BIO *bio_out; + int FuzzerInitialize(int *argc, char ***argv) { + bio_out = BIO_new_file("/dev/null", "w"); return 1; } int FuzzerTestOneInput(const uint8_t *buf, size_t len) { - static BIO *bio_out; - - if (bio_out == NULL) - bio_out = BIO_new_file("/dev/null", "w"); - (void)ASN1_parse_dump(bio_out, buf, len, 0, 0); return 0; } void FuzzerCleanup(void) { + BIO_free(bio_out); }