Project

General

Profile

Bug #11185 ยป 0001-openssl-use-RB_GC_GUARD-instead-of-volatile.patch

normalperson (Eric Wong), 05/27/2015 12:50 AM

View differences:

ext/openssl/ossl_asn1.c
1029 1029
ossl_asn1_traverse(VALUE self, VALUE obj)
1030 1030
{
1031 1031
    unsigned char *p;
1032
    volatile VALUE tmp;
1032
    VALUE tmp;
1033 1033
    long len, read = 0, offset = 0;
1034 1034

  
1035 1035
    obj = ossl_to_der_if_possible(obj);
......
1037 1037
    p = (unsigned char *)RSTRING_PTR(tmp);
1038 1038
    len = RSTRING_LEN(tmp);
1039 1039
    ossl_asn1_decode0(&p, len, &offset, 0, 1, &read);
1040
    RB_GC_GUARD(tmp);
1040 1041
    int_ossl_decode_sanity_check(len, read, offset);
1041 1042
    return Qnil;
1042 1043
}
......
1058 1059
{
1059 1060
    VALUE ret;
1060 1061
    unsigned char *p;
1061
    volatile VALUE tmp;
1062
    VALUE tmp;
1062 1063
    long len, read = 0, offset = 0;
1063 1064

  
1064 1065
    obj = ossl_to_der_if_possible(obj);
......
1066 1067
    p = (unsigned char *)RSTRING_PTR(tmp);
1067 1068
    len = RSTRING_LEN(tmp);
1068 1069
    ret = ossl_asn1_decode0(&p, len, &offset, 0, 0, &read);
1070
    RB_GC_GUARD(tmp);
1069 1071
    int_ossl_decode_sanity_check(len, read, offset);
1070 1072
    return ret;
1071 1073
}
......
1089 1091
    VALUE ary, val;
1090 1092
    unsigned char *p;
1091 1093
    long len, tmp_len = 0, read = 0, offset = 0;
1092
    volatile VALUE tmp;
1094
    VALUE tmp;
1093 1095

  
1094 1096
    obj = ossl_to_der_if_possible(obj);
1095 1097
    tmp = rb_str_new4(StringValue(obj));
......
1104 1106
	read += tmp_read;
1105 1107
	tmp_len -= tmp_read;
1106 1108
    }
1109
    RB_GC_GUARD(tmp);
1107 1110
    int_ossl_decode_sanity_check(len, read, offset);
1108 1111
    return ary;
1109 1112
}
1110
-