There is little reason for this call to fail, but there is also little
reason for not to check for it, and, since Coverity noticed
that the check is missing, just add it.
Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=
1665420
References: https://github.com/openssl/project/issues/1432
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28648)
(cherry picked from commit
19b3dcbbc28ca3269abe1b4a4213325ba07fa18f)
goto err;
if ((der = dertmp = OPENSSL_malloc(derlen)) == NULL)
goto err;
- i2d_X509_NAME(subj, &dertmp);
+ if (i2d_X509_NAME(subj, &dertmp) < 0)
+ goto err;
md = EVP_MD_fetch(x->libctx, SN_sha1, x->propq);
if (md == NULL)