Fixes Coverity
1027256
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21755)
spki = NETSCAPE_SPKI_new();
if (spki == NULL)
goto end;
- if (challenge != NULL)
- ASN1_STRING_set(spki->spkac->challenge,
- challenge, (int)strlen(challenge));
+ if (challenge != NULL
+ && !ASN1_STRING_set(spki->spkac->challenge,
+ challenge, (int)strlen(challenge)))
+ goto end;
if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
BIO_printf(bio_err, "Error setting public key\n");
goto end;