提交 da15cb7c 编写于 作者: K Kurt Roeckx

asn1parse: create the out bio during init, free it during cleanup

Reviewed-by: NRich Salz <rsalz@openssl.org>
GH: #2023
上级 ad4da7fb
......@@ -18,22 +18,21 @@
#include <openssl/x509v3.h>
#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);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册