diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2026-04-07 22:35:35 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2026-04-07 22:35:35 +0000 |
| commit | ab5fc4ac933ff67bc800e774dffce15e2a541e90 (patch) | |
| tree | 41fac85d3f2f7d74be9bfce46b1a78ff9897165d /crypto/pkcs7/pk7_doit.c | |
| parent | 808413da28df9fb93e1f304e6016b15e660f54c8 (diff) | |
Diffstat (limited to 'crypto/pkcs7/pk7_doit.c')
| -rw-r--r-- | crypto/pkcs7/pk7_doit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index b180b5848185..d6513cf3a379 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -831,6 +831,10 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) break; case NID_pkcs7_signed: si_sk = p7->d.sign->signer_info; + if (p7->d.sign->contents == NULL) { + ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT); + goto err; + } os = PKCS7_get_octet_string(p7->d.sign->contents); /* If detached data then the content is excluded */ if (PKCS7_type_is_data(p7->d.sign->contents) && p7->detached) { @@ -841,6 +845,10 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) break; case NID_pkcs7_digest: + if (p7->d.digest->contents == NULL) { + ERR_raise(ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT); + goto err; + } os = PKCS7_get_octet_string(p7->d.digest->contents); /* If detached data then the content is excluded */ if (PKCS7_type_is_data(p7->d.digest->contents) && p7->detached) { |
