diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2022-08-01 20:18:09 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2022-08-24 11:29:40 +0200 |
commit | aeadd2981b214d5e2a8f578179c17b0dccc77042 (patch) | |
tree | a96713c49ec640bf096981ada9e0c62f50227f1d /crypto | |
parent | 293ab820812b3979161c5f018c2e753bcd3b11a4 (diff) |
CMP: fix crash in check_transactionID_or_nonce() on 'actual' being NULL
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/18929)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/cmp/cmp_vfy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index 543a978c0f..b8850611d3 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -645,11 +645,11 @@ static int check_transactionID_or_nonce(ASN1_OCTET_STRING *expected, char *expected_str, *actual_str; expected_str = i2s_ASN1_OCTET_STRING(NULL, expected); - actual_str = actual == NULL ? "(none)" - : i2s_ASN1_OCTET_STRING(NULL, actual); + actual_str = actual == NULL ? NULL: i2s_ASN1_OCTET_STRING(NULL, actual); ERR_raise_data(ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED, "expected = %s, actual = %s", expected_str == NULL ? "?" : expected_str, + actual == NULL ? "(none)" : actual_str == NULL ? "?" : actual_str); OPENSSL_free(expected_str); OPENSSL_free(actual_str); |