From: Clemens Lang Date: Fri, 3 Jun 2022 11:23:36 +0000 (+0200) Subject: Fix inadvertent NULL assignments in ternary ops X-Git-Tag: openssl-3.2.0-alpha1~2560 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a01e5c29dfaf09af3960b4c8e6ec0f8171eda80;p=thirdparty%2Fopenssl.git Fix inadvertent NULL assignments in ternary ops As identified by both clang with a warning and $> git grep -P '(? CLA: trivial Reviewed-by: Dmitry Belyavskiy Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18469) --- diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index 404ad38d973..a08705abb38 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -383,7 +383,7 @@ inner_ossl_decoder_fetch(struct decoder_data_st *methdata, ERR_raise_data(ERR_LIB_OSSL_DECODER, code, "%s, Name (%s : %d), Properties (%s)", ossl_lib_ctx_get_descriptor(methdata->libctx), - name = NULL ? "" : name, id, + name == NULL ? "" : name, id, properties == NULL ? "" : properties); } diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index 5309838ff2c..7571570d281 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -392,7 +392,7 @@ inner_ossl_encoder_fetch(struct encoder_data_st *methdata, ERR_raise_data(ERR_LIB_OSSL_ENCODER, code, "%s, Name (%s : %d), Properties (%s)", ossl_lib_ctx_get_descriptor(methdata->libctx), - name = NULL ? "" : name, id, + name == NULL ? "" : name, id, properties == NULL ? "" : properties); } diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c index e41470a3d13..6f21d8f98f1 100644 --- a/crypto/store/store_meth.c +++ b/crypto/store/store_meth.c @@ -330,7 +330,7 @@ inner_loader_fetch(struct loader_data_st *methdata, "%s%s, Scheme (%s : %d), Properties (%s)", helpful_msg, ossl_lib_ctx_get_descriptor(methdata->libctx), - scheme = NULL ? "" : scheme, id, + scheme == NULL ? "" : scheme, id, properties == NULL ? "" : properties); }