Project

General

Profile

Actions

Bug #13615

closed

YAML parser stops processing at the first newline when byte order mark is present

Added by hasari (Hiro Asari) almost 7 years ago. Updated over 6 years ago.

Status:
Third Party's Issue
Target version:
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]
[ruby-core:81483]

Description

When the input has byte order mark, the YAML parser stops processing the input upon seeing the first newline.

I believe this is a violation of YAML specification. [[http://www.yaml.org/spec/1.2/spec.html#id2771184]]

[1] pry(main)> RUBY_DESCRIPTION
=> "ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]"
[2] pry(main)> require 'yaml'
=> true
[3] pry(main)> YAML.load("a: b\nc: d")
=> {"a"=>"b", "c"=>"d"}
[4] pry(main)> YAML.load("\xEF\xBB\xBF" + "a: b\nc: d")
=> {"a"=>"b"}

Updated by hsbt (Hiroshi SHIBATA) almost 7 years ago

  • Status changed from Open to Third Party's Issue
  • Assignee set to hsbt (Hiroshi SHIBATA)
  • Target version set to 2.5

Could you file this issue to https://github.com/ruby/psych ?

Actions

Also available in: Atom PDF

Like0
Like0Like0