mirror of
https://github.com/openssl/openssl.git
synced 2025-03-01 19:28:10 +08:00
apps/spkac.c: Check result of ASN1_STRING_set()
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)
This commit is contained in:
parent
79cdbe893d
commit
20baa24f9f
@ -152,9 +152,10 @@ int spkac_main(int argc, char **argv)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user