Skip to content

Commit

Permalink
rb_sandbox_init() should check whether value of argument is String. B…
Browse files Browse the repository at this point in the history
…efore changing, segfault occurred with Sandbox.new(Fixnum).

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

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5139 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
Watson1978 committed Jan 8, 2011
1 parent 227d4f9 commit 06ade3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rb_sandbox_init(VALUE obj, SEL sel, VALUE profile)
{
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;
Expand Down

0 comments on commit 06ade3f

Please sign in to comment.