Permalink
Browse files

merge revision(s) 17872:

	* ext/dl/dl.c (rb_str_to_ptr): should propagate taint to dlptr.
	* ext/dl/dl.c (rb_ary_to_ptr): ditto.
	* ext/dl/sym.c (rb_dlsym_call): should check taint of DLPtrData as
	  well.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@18479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 6101e61 commit 2315efe949eebb1587e6e05f553285ea5671e5de @shyouhei shyouhei committed Aug 11, 2008
Showing with 25 additions and 7 deletions.
  1. +9 −0 ChangeLog
  2. +11 −3 ext/dl/dl.c
  3. +1 −0 ext/dl/sym.c
  4. +4 −4 version.h
View
@@ -31,6 +31,15 @@ Mon Aug 4 13:31:41 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): strict check.
fixed [ruby-dev:33683]
+Mon Aug 11 09:37:17 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/dl/dl.c (rb_str_to_ptr): should propagate taint to dlptr.
+
+ * ext/dl/dl.c (rb_ary_to_ptr): ditto.
+
+ * ext/dl/sym.c (rb_dlsym_call): should check taint of DLPtrData as
+ well.
+
Thu Jul 17 21:42:07 2008 URABE Shyouhei <shyouhei@ruby-lang.org>
View
@@ -522,12 +522,15 @@ rb_str_to_ptr(VALUE self)
{
char *ptr;
int len;
+ VALUE p;
len = RSTRING(self)->len;
ptr = (char*)dlmalloc(len + 1);
memcpy(ptr, RSTRING(self)->ptr, len);
ptr[len] = '\0';
- return rb_dlptr_new((void*)ptr,len,dlfree);
+ p = rb_dlptr_new((void*)ptr,len,dlfree);
+ OBJ_INFECT(p, self);
+ return p;
}
VALUE
@@ -545,7 +548,12 @@ rb_ary_to_ptr(int argc, VALUE argv[], VALUE self)
ptr = rb_ary2cary(0, self, &size);
break;
}
- return ptr ? rb_dlptr_new(ptr, size, dlfree) : Qnil;
+ if (ptr) {
+ VALUE p = rb_dlptr_new(ptr, size, dlfree);
+ OBJ_INFECT(p, self);
+ return p;
+ }
+ return Qnil;
}
VALUE
@@ -563,7 +571,7 @@ rb_io_to_ptr(VALUE self)
VALUE
rb_dl_dlopen(int argc, VALUE argv[], VALUE self)
{
- rb_secure(4);
+ rb_secure(2);
return rb_class_new_instance(argc, argv, rb_cDLHandle);
}
View
@@ -492,6 +492,7 @@ rb_dlsym_call(int argc, VALUE argv[], VALUE self)
rb_raise(rb_eDLTypeError, "unexpected type of argument #%d", i);
}
}
+ rb_check_safe_obj(pval);
Data_Get_Struct(pval, struct ptr_data, data);
ANY2P(args[i]) = DLVOIDP(data->ptr);
}
View
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2008-08-08"
+#define RUBY_RELEASE_DATE "2008-08-11"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20080808
-#define RUBY_PATCHLEVEL 71
+#define RUBY_RELEASE_CODE 20080811
+#define RUBY_PATCHLEVEL 72
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2008
#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 8
+#define RUBY_RELEASE_DAY 11
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];

0 comments on commit 2315efe

Please sign in to comment.