summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkcs7.c
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2023-10-27 09:08:11 -0700
committerKazuki Yamaguchi <[email protected]>2024-05-02 16:26:11 +0900
commitc9aa63a9e06c21566c6fadda5945f04f341e4891 (patch)
tree2271f3e35b611d64b8cbc4f05392ed80cbba28a0 /ext/openssl/ossl_pkcs7.c
parenteb6f0000a4b752803ff7431d24d1a0a535a4387e (diff)
[ruby/openssl] pkcs7: raise ArgumentError for PKCS7 with no content in PKCS7.new
Fixes [Bug #19974] [pkuzco: expanded the fix for other content types] [ky: adjusted formatting and the exception type] https://github.com/ruby/openssl/commit/27e11f2d1d Co-authored-by: pkuzco <[email protected]> Co-authored-by: Kazuki Yamaguchi <[email protected]>
Diffstat (limited to 'ext/openssl/ossl_pkcs7.c')
-rw-r--r--ext/openssl/ossl_pkcs7.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 78dcbd667a..cde2ac04a4 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -346,6 +346,8 @@ ossl_pkcs7_initialize(int argc, VALUE *argv, VALUE self)
BIO_free(in);
if (!p7)
ossl_raise(rb_eArgError, "Could not parse the PKCS7");
+ if (!p7->d.ptr)
+ ossl_raise(rb_eArgError, "No content in PKCS7");
RTYPEDDATA_DATA(self) = p7;
PKCS7_free(p7_orig);