From 582fa9cde99778a98a5ddf25e5dd4b9bc961ef3e Mon Sep 17 00:00:00 2001 From: rhe Date: Mon, 23 May 2016 11:40:07 +0000 Subject: openssl: use StringValueCStr() where NUL-terminated string is expected * ext/openssl/ossl_asn1.c, ext/openssl/ossl_bn.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_digest.c ext/openssl/ossl_engine.c, ext/openssl/ossl_ns_spki.c ext/openssl/ossl_pkcs12.c, ext/openssl/ossl_pkcs7.c ext/openssl/ossl_pkey.c, ext/openssl/ossl_pkey_ec.c ext/openssl/ossl_rand.c, ext/openssl/ossl_ssl.c ext/openssl/ossl_x509attr.c, ext/openssl/ossl_x509cert.c ext/openssl/ossl_x509ext.c, ext/openssl/ossl_x509store.c: Use StringValueCStr() where NUL-terminated string is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_pkcs7.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/openssl/ossl_pkcs7.c') diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c index ad794e7120..10332d9e6b 100644 --- a/ext/openssl/ossl_pkcs7.c +++ b/ext/openssl/ossl_pkcs7.c @@ -429,12 +429,13 @@ ossl_pkcs7_sym2typeid(VALUE sym) { "digest", NID_pkcs7_digest }, }; - if (RB_TYPE_P(sym, T_SYMBOL)) sym = rb_sym2str(sym); + if (SYMBOL_P(sym)) sym = rb_sym2str(sym); else StringValue(sym); RSTRING_GETMEM(sym, s, l); + for(i = 0; ; i++){ if(i == numberof(p7_type_tab)) - ossl_raise(ePKCS7Error, "unknown type \"%s\"", s); + ossl_raise(ePKCS7Error, "unknown type \"%"PRIsVALUE"\"", sym); if(strlen(p7_type_tab[i].name) != l) continue; if(strcmp(p7_type_tab[i].name, s) == 0){ ret = p7_type_tab[i].nid; -- cgit v1.2.3