Integer overflow in String#[]=

e$B$3$s$P$s$Oe(B sheepman e$B$G$9!#e(B

String#[]= e$B$K$be(B integer overflow e$B$,B8:_$7$^$9!#e(B

$ cat integer_overflow.rb
p “abc”[1, 2**31-1] = “X”

$ ruby-1.8 -v integer_overflow.rb
ruby 1.8.6 (2007-09-01 patchlevel 5000) [i686-linux]
integer_overflow.rb:1: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-01) [i686-linux]

zsh: abort ruby-1.8 -v integer_overflow.rb

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs