From 7ce7708f610bc41dae57c6c8d130576aeb0fb6d9 Mon Sep 17 00:00:00 2001 From: sauwming Date: Mon, 6 May 2024 16:03:14 +0800 Subject: [PATCH] Fix warning of uninitialized value in fuzz-crypto --- tests/fuzz/fuzz-crypto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/fuzz/fuzz-crypto.c b/tests/fuzz/fuzz-crypto.c index 38a5ab1edc..dcf5cbdd84 100644 --- a/tests/fuzz/fuzz-crypto.c +++ b/tests/fuzz/fuzz-crypto.c @@ -45,7 +45,7 @@ void encode_base64_differential(const uint8_t *Data, size_t Size) { //OPENSSL BIO *bio, *bio_mem; - char *ssl_output; + char *ssl_output = NULL; int ssl_output_len; bio = BIO_new(BIO_f_base64()); @@ -58,6 +58,9 @@ void encode_base64_differential(const uint8_t *Data, size_t Size) { BIO_flush(bio); ssl_output_len = BIO_get_mem_data(bio_mem, &ssl_output); + if (ssl_output_len <= 0) { + abort(); + } //Differential int result = memcmp(pj_output, ssl_output, ssl_output_len);