summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkey_dh.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 17:41:56 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-29 17:41:56 +0000
commit2745d527b34b7f87ab7684b1451465e5e2ed8880 (patch)
tree2f33c383504947747de3a4b93edc7cd723b545ad /ext/openssl/ossl_pkey_dh.c
parent9df121034a09aced529bf50e0ae2226baaaeb925 (diff)
* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),
ext/openssl/ossl_pkey_dh.c (ossl_dh_s_generate) (ossl_dh_initialize), ext/openssl/ossl_pkey_dsa.c (ossl_dsa_s_generate), ext/openssl/ossl_rand.c (ossl_rand_bytes) (ossl_rand_pseudo_bytes, ossl_rand_egd_bytes), ext/openssl/ossl_x509store.c (ossl_x509stctx_set_error): Do not use FIX2INT() without checking the value type. Use NUM2INT() instead; found by akr in [ruby-dev:34890]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dh.c')
-rw-r--r--ext/openssl/ossl_pkey_dh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index bd4cc75..02c3d99 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -116,9 +116,9 @@ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
VALUE size, gen, obj;
if (rb_scan_args(argc, argv, "11", &size, &gen) == 2) {
- g = FIX2INT(gen);
+ g = NUM2INT(gen);
}
- dh = dh_generate(FIX2INT(size), g);
+ dh = dh_generate(NUM2INT(size), g);
obj = dh_instance(klass, dh);
if (obj == Qfalse) {
DH_free(dh);
@@ -158,7 +158,7 @@ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
}
else if (FIXNUM_P(arg)) {
if (!NIL_P(gen)) {
- g = FIX2INT(gen);
+ g = NUM2INT(gen);
}
if (!(dh = dh_generate(FIX2INT(arg), g))) {
ossl_raise(eDHError, NULL);