summaryrefslogtreecommitdiffstats
path: root/crypto/encode_decode
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-06-14 16:43:28 +1000
committerPauli <pauli@openssl.org>2021-06-15 17:36:42 +1000
commit42e97dde808e6471575696fdec41e2f8d2ef9feb (patch)
tree33705d9fb6435846e3223d54a1ab618d8ac6db30 /crypto/encode_decode
parentf77208693ec3bda99618e6f76c0f8d279c0077bb (diff)
Add missing NULL check in OSSL_DECODER_from_bio().
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15733)
Diffstat (limited to 'crypto/encode_decode')
-rw-r--r--crypto/encode_decode/decoder_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c
index 4053eac62e..c637b5bfef 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 "