]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix inadvertent NULL assignments in ternary ops
authorClemens Lang <cllang@redhat.com>
Fri, 3 Jun 2022 11:23:36 +0000 (13:23 +0200)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sun, 5 Jun 2022 09:09:51 +0000 (11:09 +0200)
As identified by both clang with a warning and
$> git grep -P '(?<![!=])= NULL \?'

Signed-off-by: Clemens Lang <cllang@redhat.com>
CLA: trivial

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18469)

crypto/encode_decode/decoder_meth.c
crypto/encode_decode/encoder_meth.c
crypto/store/store_meth.c

index 404ad38d9731fc460c218487e1e6ad6144909f06..a08705abb383f7c2ccdc73de4ee7f2f7e299a2b5 100644 (file)
@@ -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 ? "<null>" : name, id,
+                       name == NULL ? "<null>" : name, id,
                        properties == NULL ? "<null>" : properties);
     }
 
index 5309838ff2c561db9a3bac4807e3411eeb123140..7571570d28125428232566985a8e050264fd54af 100644 (file)
@@ -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 ? "<null>" : name, id,
+                       name == NULL ? "<null>" : name, id,
                        properties == NULL ? "<null>" : properties);
     }
 
index e41470a3d13ba7122ae310dd3a3cbdacaa551642..6f21d8f98f1917b06049f2ed3b2a8edc46b4e8e4 100644 (file)
@@ -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 ? "<null>" : scheme, id,
+                       scheme == NULL ? "<null>" : scheme, id,
                        properties == NULL ? "<null>" : properties);
     }