ffi 1.11.2 → 1.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04c74309ebb2a5097fc2451c48a5e7fee0b8860936802ba3bb451acb772b768a
4
- data.tar.gz: 4c15514c883db50211a359ab0a08126c0feac0530e2328fbe96abc7dbd242724
3
+ metadata.gz: 644662e700692019ada112b10a164622c08978bbe2aecfeb38205a43df099e28
4
+ data.tar.gz: 8699b821c2200c62c49c4265d5ce8b67862f53d71e1a2862b41ed5f44eedad87
5
5
  SHA512:
6
- metadata.gz: 1bae5351b7b33d23817ee245894ff31f0c1afffbca4f4ffff42975ea4a61eeab84c0020de2ad0aa81db578379acc7a3bf8713f3415e2d8755809b1ffa32ea1c0
7
- data.tar.gz: 569166da61cfacb4d96a1bd079eb14533766b0663da2f6cd16845cfbaa8cd41bb736835ffdab339babce31f861e8f2a3a815c43b4e9315fcc4f9890b71aa441a
6
+ metadata.gz: 6aee46baf520f91e112a1fdcd40218f51f100b50f56d126a94982d341f38919f3f550831db1c9da569d8457c2b50707654681b06ae6cae48ac4597d927b0569d
7
+ data.tar.gz: c728916db8dad5ec04403ab9cead139b870f56d3e0a34f0b08ec467f9a153c1f29d2f9ad2e30bb3056476a4dd3d42edebfdfbd9f88477f9e08862601cb3277a0
@@ -1,3 +1,10 @@
1
+ 1.11.3 / 2019-11-25
2
+ -------------------
3
+
4
+ Removed:
5
+ * Remove support for tainted objects which cause deprecation warnings in ruby-2.7. #730
6
+
7
+
1
8
  1.11.2 / 2019-11-11
2
9
  -------------------
3
10
 
@@ -417,7 +417,7 @@ memory_get_string(int argc, VALUE* argv, VALUE self)
417
417
  checkBounds(ptr, off, len);
418
418
 
419
419
  end = memchr(ptr->address + off, 0, len);
420
- return rb_tainted_str_new((char *) ptr->address + off,
420
+ return rb_str_new((char *) ptr->address + off,
421
421
  (end != NULL ? end - ptr->address - off : len));
422
422
  }
423
423
 
@@ -453,7 +453,7 @@ memory_get_array_of_string(int argc, VALUE* argv, VALUE self)
453
453
 
454
454
  for (i = 0; i < count; ++i) {
455
455
  const char* strptr = *((const char**) (ptr->address + off) + i);
456
- rb_ary_push(retVal, (strptr == NULL ? Qnil : rb_tainted_str_new2(strptr)));
456
+ rb_ary_push(retVal, (strptr == NULL ? Qnil : rb_str_new2(strptr)));
457
457
  }
458
458
 
459
459
  } else {
@@ -463,7 +463,7 @@ memory_get_array_of_string(int argc, VALUE* argv, VALUE self)
463
463
  if (strptr == NULL) {
464
464
  break;
465
465
  }
466
- rb_ary_push(retVal, rb_tainted_str_new2(strptr));
466
+ rb_ary_push(retVal, rb_str_new2(strptr));
467
467
  }
468
468
  }
469
469
 
@@ -542,7 +542,7 @@ memory_get_bytes(VALUE self, VALUE offset, VALUE length)
542
542
  checkRead(ptr);
543
543
  checkBounds(ptr, off, len);
544
544
 
545
- return rb_tainted_str_new((char *) ptr->address + off, len);
545
+ return rb_str_new((char *) ptr->address + off, len);
546
546
  }
547
547
 
548
548
  /*
@@ -583,10 +583,6 @@ memory_put_bytes(int argc, VALUE* argv, VALUE self)
583
583
  checkWrite(ptr);
584
584
  checkBounds(ptr, off, len);
585
585
 
586
- if (rb_safe_level() >= 1 && OBJ_TAINTED(str)) {
587
- rb_raise(rb_eSecurityError, "Writing unsafe string to memory");
588
- return Qnil;
589
- }
590
586
  memcpy(ptr->address + off, RSTRING_PTR(str) + idx, len);
591
587
 
592
588
  return self;
@@ -718,7 +714,7 @@ memory_op_get_strptr(AbstractMemory* ptr, long offset)
718
714
  memcpy(&tmp, ptr->address + offset, sizeof(tmp));
719
715
  }
720
716
 
721
- return tmp != NULL ? rb_tainted_str_new2(tmp) : Qnil;
717
+ return tmp != NULL ? rb_str_new2(tmp) : Qnil;
722
718
  }
723
719
 
724
720
  static void
@@ -298,10 +298,6 @@ rbffi_SetupCallParams(int argc, VALUE* argv, int paramCount, Type** paramTypes,
298
298
  param->ptr = NULL;
299
299
 
300
300
  } else {
301
- if (rb_safe_level() >= 1 && OBJ_TAINTED(argv[argidx])) {
302
- rb_raise(rb_eSecurityError, "Unsafe string parameter");
303
- }
304
-
305
301
  param->ptr = StringValueCStr(argv[argidx]);
306
302
  }
307
303
 
@@ -164,7 +164,7 @@ library_dlerror(VALUE self)
164
164
  {
165
165
  char errmsg[1024];
166
166
  dl_error(errmsg, sizeof(errmsg));
167
- return rb_tainted_str_new2(errmsg);
167
+ return rb_str_new2(errmsg);
168
168
  }
169
169
 
170
170
  static void
@@ -724,7 +724,7 @@ invoke_callback(VALUE data)
724
724
  param = rbffi_longdouble_new(*(long double *) parameters[i]);
725
725
  break;
726
726
  case NATIVE_STRING:
727
- param = (*(void **) parameters[i] != NULL) ? rb_tainted_str_new2(*(char **) parameters[i]) : Qnil;
727
+ param = (*(void **) parameters[i] != NULL) ? rb_str_new2(*(char **) parameters[i]) : Qnil;
728
728
  break;
729
729
  case NATIVE_POINTER:
730
730
  param = rbffi_Pointer_NewInstance(*(void **) parameters[i]);
@@ -80,7 +80,7 @@ rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr)
80
80
  return rbffi_longdouble_new(*(long double *) ptr);
81
81
 
82
82
  case NATIVE_STRING:
83
- return (*(void **) ptr != NULL) ? rb_tainted_str_new2(*(char **) ptr) : Qnil;
83
+ return (*(void **) ptr != NULL) ? rb_str_new2(*(char **) ptr) : Qnil;
84
84
  case NATIVE_POINTER:
85
85
  return rbffi_Pointer_NewInstance(*(void **) ptr);
86
86
  case NATIVE_BOOL:
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.11.2'
2
+ VERSION = '1.11.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne Meissner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-11 00:00:00.000000000 Z
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake