decoder_process: data_structure can be NULL
authorTomas Mraz <tomas@openssl.org>
Fri, 12 Mar 2021 15:35:28 +0000 (16:35 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 16 Mar 2021 10:25:18 +0000 (11:25 +0100)
Check it before dereferencing.

Fixes #14530

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14531)

crypto/encode_decode/decoder_lib.c

index e928561b81b5e08068b061215494834f09e1498d..a644924aebc6f6e600a5cd036363a2a587f00092 100644 (file)
@@ -608,7 +608,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
          * too special knowledge.
          */
         trace_data_structure = data_structure;
-        if (data_type != NULL
+        if (data_type != NULL && data_structure != NULL
             && strcasecmp(data_structure, "type-specific") == 0)
             data_structure = NULL;