summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509attr.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-24 00:09:47 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-24 00:09:47 +0000
commit22af994534bcdf81138b42c741a8b57fe09453e1 (patch)
tree4d6678955d122c015aedbfe7c3fc246b2e8162d1 /ext/openssl/ossl_x509attr.c
parentf0189a046c5b78cabcd521c430e48e8fc5fc29d4 (diff)
downloadruby-22af994534bcdf81138b42c741a8b57fe09453e1.tar.gz
ruby-22af994534bcdf81138b42c741a8b57fe09453e1.tar.xz
ruby-22af994534bcdf81138b42c741a8b57fe09453e1.zip
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
functions may replace the pointer indicated by the first argument. * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto. * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509attr.c')
-rw-r--r--ext/openssl/ossl_x509attr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/ossl_x509attr.c b/ext/openssl/ossl_x509attr.c
index 576ad4c40..f03302d35 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -91,12 +91,13 @@ ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
X509_ATTRIBUTE *attr;
unsigned char *p;
+ GetX509Attr(self, attr);
if(rb_scan_args(argc, argv, "11", &oid, &value) == 1){
- GetX509Attr(self, attr);
oid = ossl_to_der_if_possible(oid);
StringValue(oid);
p = RSTRING(oid)->ptr;
- if(!d2i_X509_ATTRIBUTE(&attr, &p, RSTRING(oid)->len)){
+ if(!d2i_X509_ATTRIBUTE((X509_ATTRIBUTE**)&DATA_PTR(self),
+ &p, RSTRING(oid)->len)){
ossl_raise(eX509AttrError, NULL);
}
return self;