Skip to content

Commit

Permalink
Prevent overflow of Fixnum#to_s.
Browse files Browse the repository at this point in the history
  • Loading branch information
masamitsu-murase committed Feb 3, 2013
1 parent 2087526 commit 641fc99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ fix_minus(mrb_state *mrb, mrb_value self)
mrb_value
mrb_fix2str(mrb_state *mrb, mrb_value x, int base)
{
char buf[64], *b = buf + sizeof buf;
char buf[sizeof(mrb_int)*CHAR_BIT+2], *b = buf + sizeof buf;
mrb_int val = mrb_fixnum(x);
int neg = 0;

Expand Down

0 comments on commit 641fc99

Please sign in to comment.