Skip to content

Commit 7d7ed2c

Browse files
committed
merge revision(s) 50646: [Backport ruby#11185]
* ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode, ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile [ruby-core:69371] [Bug ruby#11185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 16b551f commit 7d7ed2c

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Tue Jun 9 16:26:48 2015 Eric Wong <e@80x24.org>
2+
3+
* ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode,
4+
ossl_asn1_decode_all): use RB_GC_GUARD instead of volatile
5+
[ruby-core:69371] [Bug #11185]
6+
17
Tue Jun 9 16:24:25 2015 NARUSE, Yui <naruse@ruby-lang.org>
28

39
* win32/win32.c (setup_overlapped): seek to the file end only when

ext/openssl/ossl_asn1.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,15 @@ static VALUE
10291029
ossl_asn1_traverse(VALUE self, VALUE obj)
10301030
{
10311031
unsigned char *p;
1032-
volatile VALUE tmp;
1032+
VALUE tmp;
10331033
long len, read = 0, offset = 0;
10341034

10351035
obj = ossl_to_der_if_possible(obj);
10361036
tmp = rb_str_new4(StringValue(obj));
10371037
p = (unsigned char *)RSTRING_PTR(tmp);
10381038
len = RSTRING_LEN(tmp);
10391039
ossl_asn1_decode0(&p, len, &offset, 0, 1, &read);
1040+
RB_GC_GUARD(tmp);
10401041
int_ossl_decode_sanity_check(len, read, offset);
10411042
return Qnil;
10421043
}
@@ -1058,14 +1059,15 @@ ossl_asn1_decode(VALUE self, VALUE obj)
10581059
{
10591060
VALUE ret;
10601061
unsigned char *p;
1061-
volatile VALUE tmp;
1062+
VALUE tmp;
10621063
long len, read = 0, offset = 0;
10631064

10641065
obj = ossl_to_der_if_possible(obj);
10651066
tmp = rb_str_new4(StringValue(obj));
10661067
p = (unsigned char *)RSTRING_PTR(tmp);
10671068
len = RSTRING_LEN(tmp);
10681069
ret = ossl_asn1_decode0(&p, len, &offset, 0, 0, &read);
1070+
RB_GC_GUARD(tmp);
10691071
int_ossl_decode_sanity_check(len, read, offset);
10701072
return ret;
10711073
}
@@ -1089,7 +1091,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
10891091
VALUE ary, val;
10901092
unsigned char *p;
10911093
long len, tmp_len = 0, read = 0, offset = 0;
1092-
volatile VALUE tmp;
1094+
VALUE tmp;
10931095

10941096
obj = ossl_to_der_if_possible(obj);
10951097
tmp = rb_str_new4(StringValue(obj));
@@ -1104,6 +1106,7 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
11041106
read += tmp_read;
11051107
tmp_len -= tmp_read;
11061108
}
1109+
RB_GC_GUARD(tmp);
11071110
int_ossl_decode_sanity_check(len, read, offset);
11081111
return ary;
11091112
}

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.7"
22
#define RUBY_RELEASE_DATE "2015-06-09"
3-
#define RUBY_PATCHLEVEL 364
3+
#define RUBY_PATCHLEVEL 365
44

55
#define RUBY_RELEASE_YEAR 2015
66
#define RUBY_RELEASE_MONTH 6

0 commit comments

Comments
 (0)