Project

General

Profile

Bug #17186

Integer overflow in "chr" error message (out of char range)

Added by semaperepelitsa (Simon Perepelitsa) 28 days ago. Updated 15 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
[ruby-core:100113]

Description

Example:

irb(main):001:0> 300_000_000.chr
RangeError (300000000 out of char range)
irb(main):002:0> 3_000_000_000.chr
RangeError (-1294967296 out of char range)
irb(main):003:0> 30_000_000_000.chr
RangeError (30000000000 out of char range)

Updated by peterzhu2118 (Peter Zhu) 24 days ago

Hey Semyon. Thanks for reporting the bug. I PR'd a patch that should fix the issue: https://github.com/ruby/ruby/pull/3602. Let me know how it looks!

Updated by jeremyevans0 (Jeremy Evans) 15 days ago

  • Status changed from Open to Closed

Also available in: Atom PDF