summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2022-08-05 18:42:06 +0900
committerKazuki Yamaguchi <k@rhe.jp>2022-10-17 16:35:35 +0900
commita98096349ec7280edabf3822d2c6932ac6e63634 (patch)
tree03df05a79ed6729b2a285a140e5b7205360075ac /ext/openssl
parentc865e8d161f40c6e9cce411c92e313a91b14124e (diff)
downloadruby-a98096349ec7280edabf3822d2c6932ac6e63634.tar.gz
[ruby/openssl] Check if the option is an Hash in `pkey_ctx_apply_options0()`
causes SEGV if it is an Array or something like that. https://github.com/ruby/openssl/commit/ef23525210
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/ossl_pkey.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index 24d0da4683..0dafa6dc71 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -200,6 +200,7 @@ static VALUE
pkey_ctx_apply_options0(VALUE args_v)
{
VALUE *args = (VALUE *)args_v;
+ Check_Type(args[1], T_HASH);
rb_block_call(args[1], rb_intern("each"), 0, NULL,
pkey_ctx_apply_options_i, args[0]);