aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey.c
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2022-08-05 18:42:06 +0900
committerNobuhiro IMAI <nov@yo.rim.or.jp>2022-08-08 18:37:49 +0900
commitef2352521089998842672106d2c988387ffb6698 (patch)
tree7bac4e2ed1e19fe0eee10f07ca1b23506981351b /ext/openssl/ossl_pkey.c
parentee64d93cb20e7fca80eddbf711c56ae2fac9a825 (diff)
downloadruby-openssl-ef2352521089998842672106d2c988387ffb6698.tar.gz
Check if the option is an Hash in `pkey_ctx_apply_options0()`
causes SEGV if it is an Array or something like that.
Diffstat (limited to 'ext/openssl/ossl_pkey.c')
-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 2a4835a2..7fcb570c 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]);