From: Shane Lontis Date: Mon, 14 Jun 2021 06:43:28 +0000 (+1000) Subject: Add missing NULL check in OSSL_DECODER_from_bio(). X-Git-Tag: openssl-3.0.0-beta1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42e97dde808e6471575696fdec41e2f8d2ef9feb;p=thirdparty%2Fopenssl.git Add missing NULL check in OSSL_DECODER_from_bio(). Reviewed-by: Tim Hudson Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15733) --- diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c index 4053eac62e8..c637b5bfefe 100644 --- a/crypto/encode_decode/decoder_lib.c +++ b/crypto/encode_decode/decoder_lib.c @@ -48,6 +48,11 @@ int OSSL_DECODER_from_bio(OSSL_DECODER_CTX *ctx, BIO *in) int ok = 0; BIO *new_bio = NULL; + if (in == NULL) { + ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + if (OSSL_DECODER_CTX_get_num_decoders(ctx) == 0) { ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND, "No decoders were found. For standard decoders you need "