summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Meissner <wmeissner@gmail.com>2012-08-11 08:32:20 +1000
committerWayne Meissner <wmeissner@gmail.com>2012-08-11 08:33:57 +1000
commit7a1016a15964762ce240216068069ef5cc246458 (patch)
treede43f902d6d5e8acbb36a37b2b6b9e1a0a4ddf25
parente780d1e073652cef4e54ee75da728791a04326b2 (diff)
downloadffi-7a1016a15964762ce240216068069ef5cc246458.tar.gz
Remove safe level checking
-rw-r--r--ext/ffi_c/AbstractMemory.c5
-rw-r--r--ext/ffi_c/Call.c5
2 files changed, 1 insertions, 9 deletions
diff --git a/ext/ffi_c/AbstractMemory.c b/ext/ffi_c/AbstractMemory.c
index 1b3ed46..21cd181 100644
--- a/ext/ffi_c/AbstractMemory.c
+++ b/ext/ffi_c/AbstractMemory.c
@@ -431,11 +431,6 @@ memory_put_string(VALUE self, VALUE offset, VALUE str)
checkWrite(ptr);
checkBounds(ptr, off, len + 1);
-
- if (rb_safe_level() >= 1 && OBJ_TAINTED(str)) {
- rb_raise(rb_eSecurityError, "Writing unsafe string to memory");
- return Qnil;
- }
memcpy(ptr->address + off, RSTRING_PTR(str), len);
*((char *) ptr->address + off + len) = '\0';
diff --git a/ext/ffi_c/Call.c b/ext/ffi_c/Call.c
index 856d485..76cbb69 100644
--- a/ext/ffi_c/Call.c
+++ b/ext/ffi_c/Call.c
@@ -377,10 +377,7 @@ getPointer(VALUE value, int type)
return memory != NULL ? memory->address : NULL;
} else if (type == T_STRING) {
-
- if (rb_safe_level() >= 1 && OBJ_TAINTED(value)) {
- rb_raise(rb_eSecurityError, "Unsafe string parameter");
- }
+
return StringValuePtr(value);
} else if (type == T_NIL) {