summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-21 13:09:55 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-21 13:09:55 +0000
commitd2faf61018b834efdcba69db8cd6703661247513 (patch)
tree475f49ef2d941f0d5fc33cedf6b1308e5b409f71
parent15e358e2a70b3225a952bcc47339c0dd92a19202 (diff)
downloadruby-d2faf61018b834efdcba69db8cd6703661247513.tar.gz
ruby-d2faf61018b834efdcba69db8cd6703661247513.tar.xz
ruby-d2faf61018b834efdcba69db8cd6703661247513.zip
* ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
ossl_asn1_decode_all): temporary value should be marked volatile. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--ext/openssl/ossl_asn1.c22
2 files changed, 20 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 517fa971f..7517938e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
+Tue Dec 21 22:07:33 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
+ ossl_asn1_decode_all): temporary value should be marked volatile.
+
Tue Dec 21 14:40:02 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
- * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode):
- use rb_str_new4 to avoid SEGV. fix [ruby-dev:25261]
+ * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
+ ossl_asn1_decode_all): use rb_str_new4 to avoid SEGV.
+ fix [ruby-dev:25261]
* test/openssl/test_asn1.rb: add tests for OpenSSL::ASN1.
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 8b71b8cb6..1ce5fa50c 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -813,11 +813,12 @@ ossl_asn1_traverse(VALUE self, VALUE obj)
{
unsigned char *p;
long offset = 0;
+ volatile VALUE tmp;
obj = ossl_to_der_if_possible(obj);
- obj = rb_str_new4(StringValue(obj));
- p = RSTRING(obj)->ptr;
- ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 0, 1);
+ tmp = rb_str_new4(StringValue(obj));
+ p = RSTRING(tmp)->ptr;
+ ossl_asn1_decode0(&p, RSTRING(tmp)->len, &offset, 0, 0, 1);
return Qnil;
}
@@ -828,11 +829,12 @@ ossl_asn1_decode(VALUE self, VALUE obj)
VALUE ret, ary;
unsigned char *p;
long offset = 0;
+ volatile VALUE tmp;
obj = ossl_to_der_if_possible(obj);
- obj = rb_str_new4(StringValue(obj));
- p = RSTRING(obj)->ptr;
- ary = ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 1, 0);
+ tmp = rb_str_new4(StringValue(obj));
+ p = RSTRING(tmp)->ptr;
+ ary = ossl_asn1_decode0(&p, RSTRING(tmp)->len, &offset, 0, 1, 0);
ret = rb_ary_entry(ary, 0);
return ret;
@@ -844,12 +846,12 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
VALUE ret;
unsigned char *p;
long offset = 0;
+ volatile VALUE tmp;
obj = ossl_to_der_if_possible(obj);
- StringValue(obj);
- obj = rb_str_new4(obj);
- p = RSTRING(obj)->ptr;
- ret = ossl_asn1_decode0(&p, RSTRING(obj)->len, &offset, 0, 0, 0);
+ tmp = rb_str_new4(StringValue(obj));
+ p = RSTRING(tmp)->ptr;
+ ret = ossl_asn1_decode0(&p, RSTRING(tmp)->len, &offset, 0, 0, 0);
return ret;
}