aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-13 00:08:25 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-21 00:46:34 +0900
commitcc4e644e08e9217dd3c8fc347bfde7012a2508ac (patch)
treee9391a3c89e514c20957894963811c9c9cbee118
parente849909ed956fa6689a8f3b6af12d139ca7986b8 (diff)
downloadruby-cc4e644e08e9217dd3c8fc347bfde7012a2508ac.tar.gz
ossl_##keytype##_get_##name: return Qnil if BIGNUM is NULL
-rw-r--r--ext/openssl/ossl_pkey.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 6c115179dc..6eb51a76bd 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -114,7 +114,10 @@ static VALUE ossl_##keytype##_get_##name(VALUE self) \
GetPKey(self, pkey); \
obj = EVP_PKEY_get0_##type(pkey); \
get; \
- return ossl_bn_new(name); \
+ if (name) \
+ return ossl_bn_new(name); \
+ else \
+ return Qnil; \
} \
/* \
* call-seq: \