mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext: use RARRAY_CONST_PTR
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore reference instead of RARRAY_PTR, to keep the array WB-protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
52912db4a8
commit
3553a86eb5
20 changed files with 123 additions and 106 deletions
|
@ -423,13 +423,13 @@ ossl_x509req_set_attributes(VALUE self, VALUE ary)
|
|||
|
||||
Check_Type(ary, T_ARRAY);
|
||||
for (i=0;i<RARRAY_LEN(ary); i++) {
|
||||
OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Attr);
|
||||
OSSL_Check_Kind(RARRAY_CONST_PTR(ary)[i], cX509Attr);
|
||||
}
|
||||
GetX509Req(self, req);
|
||||
sk_X509_ATTRIBUTE_pop_free(req->req_info->attributes, X509_ATTRIBUTE_free);
|
||||
req->req_info->attributes = NULL;
|
||||
for (i=0;i<RARRAY_LEN(ary); i++) {
|
||||
item = RARRAY_PTR(ary)[i];
|
||||
item = RARRAY_CONST_PTR(ary)[i];
|
||||
attr = DupX509AttrPtr(item);
|
||||
if (!X509_REQ_add1_attr(req, attr)) {
|
||||
ossl_raise(eX509ReqError, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue