From: Dr. David von Oheimb Date: Mon, 1 Aug 2022 18:18:09 +0000 (+0200) Subject: CMP: fix crash in check_transactionID_or_nonce() on 'actual' being NULL X-Git-Tag: openssl-3.2.0-alpha1~2163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeadd2981b214d5e2a8f578179c17b0dccc77042;p=thirdparty%2Fopenssl.git CMP: fix crash in check_transactionID_or_nonce() on 'actual' being NULL Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: David von Oheimb (Merged from https://github.com/openssl/openssl/pull/18929) --- diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index 543a978c0f0..b8850611d33 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);