Actions
Bug #15584
closedJSON parse error message too long, looks like a crash
Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin14] `
Description
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
Actions
Like0
Like0