Issue #15584 has been reported by cwardata (cw data).

----------------------------------------
Bug #15584: JSON parse error message too long, looks like a crash
https://bugs.ruby-lang.org/issues/15584

* Author: cwardata (cw data)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin14] `
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
When trying to parse text into JSON, parsing this specific input fills up my terminal with the content of the unzipped data. I then can't see what the error message is and it looks very much like a crash. I think there should be some limit on the number of characters from the failed parsed input.

```
require 'open-uri'; require 'base64'; require 'json'; s = open('https://gist.githubusercontent.com/cwardata/ae8d0a408fef1b1c0c7005e6b3b53769/raw/c87e639caaa0d3eb412dbe950281a37edd174cdc/gzip-crash-testcase.txt').read; JSON.parse(Zlib::GzipReader.new(StringIO.new(Base64.decode64(s))).readlines.join); nil
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>