[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

YAML errors with indentation indicator

From: "Akira FUNAI" <funai.akira@...>
Date: 2006-09-11 07:10:07 UTC
List: ruby-core #8836
Hi,

1) malformed block scalar emitted with to_yaml()

% ruby -v
ruby 1.8.5 (2006-09-10) [i686-darwin8.7.1]

% cat yamlbug1.rb
require 'yaml'

y = "\n abc\nxyz".to_yaml
puts y

YAML.load(y)

% ruby yamlbug1.rb
--- |-

 abc
xyz
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 3,
col 0: `xyz' (ArgumentError)
        from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
        from yamlbug1.rb:6

The YAML document lacks an indentation indicator (required as the
first character of the first non-empty line is space).


2) YAML.load() misreads an indentation indicator

% ruby -v
ruby 1.8.5 (2006-09-10) [i686-darwin8.7.1]

% cat yamlbug2.rb
require 'yaml'

y = <<'eos'
--- |4
    abc
    xyz
eos

p YAML.load(y) # -> should be "abc\nxyz\n"

% ruby yamlbug2.rb
" abc\n xyz\n"

YAML.load() strips just three indentation spaces instead of four.

---

In This Thread

Prev Next