diff options
| author | Eugene Syromiatnikov <[email protected]> | 2025-09-15 03:31:31 +0200 |
|---|---|---|
| committer | Tomas Mraz <[email protected]> | 2025-09-25 16:59:52 +0200 |
| commit | 19b3dcbbc28ca3269abe1b4a4213325ba07fa18f (patch) | |
| tree | 06a448d51ab8f72d8ceadecc8f37fa4124c90ff1 | |
| parent | Fix EVP_PKEY_can_sign() handling of NULL from query_operation_name() (diff) | |
| download | openssl-19b3dcbbc28ca3269abe1b4a4213325ba07fa18f.tar.gz openssl-19b3dcbbc28ca3269abe1b4a4213325ba07fa18f.zip | |
crypto/x509/t_x509.c: check i2d_X509_NAME() return value in X509_ocspid_print()
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 <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
(Merged from https://github.com/openssl/openssl/pull/28648)
| -rw-r--r-- | crypto/x509/t_x509.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c index 192998d4533..4490c513921 100644 --- a/crypto/x509/t_x509.c +++ b/crypto/x509/t_x509.c @@ -247,7 +247,8 @@ int X509_ocspid_print(BIO *bp, X509 *x) 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) |
