Project

General

Profile

Actions

Bug #19754

closed

`IO::Buffer#get_string` raises unsuitable exception for too large offset

Added by nobu (Nobuyoshi Nakada) 11 months ago. Updated 7 months ago.

Status:
Closed
Target version:
-
[ruby-core:114072]

Description

The message seems suitable when both of offset and length are given.

IO::Buffer.for("test").get_string(5, 0) #=> Specified offset+length exceeds buffer size! (ArgumentError)

But without length, it doesn't seem to check offset properly.

IO::Buffer.for("test").get_string(5) #=> negative string size (or size too big) (ArgumentError)

https://github.com/ruby/ruby/pull/8016

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0