Permalink
Browse files

Thread#priority= should raise SecurityError when $SAFE is 4

  • Loading branch information...
1 parent 79a4e82 commit e767a912b1f6ed9841e03d17023079b26d9be55d @Watson1978 Watson1978 committed Feb 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 thread.c
View
@@ -921,9 +921,10 @@ rb_thread_priority_set(VALUE thread, SEL sel, VALUE prio)
// FIXME this doesn't really minic what 1.9 does, but do we care?
int policy;
struct sched_param param;
+ rb_secure(4);
pthread_assert(pthread_getschedparam(GetThreadPtr(thread)->thread,
&policy, &param));
-
+
const int max = sched_get_priority_max(policy);
const int min = sched_get_priority_min(policy);

0 comments on commit e767a91

Please sign in to comment.