[macruby-changes] [5139] MacRuby/trunk/sandbox.c

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 7 23:14:37 PST 2011


Revision: 5139
          http://trac.macosforge.org/projects/ruby/changeset/5139
Author:   watson1978 at gmail.com
Date:     2011-01-07 23:14:32 -0800 (Fri, 07 Jan 2011)
Log Message:
-----------
rb_sandbox_init() should check whether value of argument is String. Before changing, segfault occurred with Sandbox.new(Fixnum).

Test:
{{{
$ macruby -e 'Sandbox.new(1)'
}}}

Modified Paths:
--------------
    MacRuby/trunk/sandbox.c

Modified: MacRuby/trunk/sandbox.c
===================================================================
--- MacRuby/trunk/sandbox.c	2011-01-08 03:19:14 UTC (rev 5138)
+++ MacRuby/trunk/sandbox.c	2011-01-08 07:14:32 UTC (rev 5139)
@@ -31,6 +31,7 @@
 {
     rb_sandbox_t *box;
 
+    StringValue(profile);
     Data_Get_Struct(obj, rb_sandbox_t, box);
     GC_WB(&box->profile, ruby_strdup(RSTRING_PTR(profile)));
     box->flags = 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110107/6867756f/attachment.html>


More information about the macruby-changes mailing list