Skip to content

Conversation

@jhawthorn
Copy link
Member

@jhawthorn jhawthorn commented Jan 12, 2023

Previously in the JSON::Ext parser, when we encountered an "Infinity" token (and we weren't allowing NaN/Infinity) we would try to display the "unexpected token" at the character before.

This was found by OSS-Fuzz due to its buffer underflow of exactly 1 byte. Due to low impact this isn't being tracked as a security issue.

@hsbt
Copy link
Member

hsbt commented Jan 23, 2023

@jhawthorn Thanks! Can you omit or pend with failing tests like RUBY_PLATFORM =~ /java/?

Previously in the JSON::Ext parser, when we encountered an "Infinity"
token (and weren't allowing NaN/Infinity) we would try to display the
"unexpected token" at the character before.
@hsbt hsbt merged commit fa4725f into ruby:master Dec 1, 2023
@eregon
Copy link
Member

eregon commented Dec 1, 2023

RUBY_PLATFORM =~ /java/

Nit: it seems needlessly expensive to use a regexp for this.
Also RUBY_ENGINE seems much clearer: RUBY_ENGINE == "jruby".
TruffleRuby defines RUBY_PLATFORM like CRuby with the native platform, so RUBY_PLATFORM == "java" is the same as RUBY_ENGINE == "jruby" but less clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants