ohler55/oj — pull request #154 by lautis (2014-06-04 13:27:47+00:00)
Title: Raise Oj::ParseError when string contains NULL byte

If I parse a string with a NULL byte, Oj throws ArgumentError from `rb_string_value_cstr`, although the case really is an parse error.

To enable proper error messaging, I changed parse.c to use `rb_string_value_ptr` instead of `rb_string_value_cstr` and detect string ends using `pi->end`. If a NULL byte is encountered when parsing strings, proper error is raised. The NULL detection is only needed in `read_str` as `read_escaped_str` has a whitelist of allowed characters which doesn't include NULL.

The behaviour can be reproduced with

```ruby
Oj.load("\"\0\"")
```