yajl-ruby 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of yajl-ruby might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +3 -8
- data/ext/yajl/yajl_encode.c +2 -2
- data/lib/yajl/bzip2.rb +2 -2
- data/lib/yajl/http_stream.rb +3 -2
- data/lib/yajl/version.rb +1 -1
- data/spec/parsing/one_off_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2211f169082b89b1385a841f79d445cd559b405c
|
4
|
+
data.tar.gz: 9074ca9bab2acf80a0a7069f2a608ee958b2eea8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f296b807da6097dec709b153364def6cae62187223e64027871103261800e8edda82d5d2bfe96a9dbfb3e29a6b84f56e39c09b45d3bafd423335e86aa52186
|
7
|
+
data.tar.gz: 89bee3f6029488f771d15a4ebc9e910a8c1ca7d276ef5ad001bb118e7754397bfb4a4065cf5a8b8cc5edffe222bdb669742b6cbe9c6572d3656b3d683393c2b8
|
data/.travis.yml
CHANGED
data/ext/yajl/yajl_encode.c
CHANGED
@@ -162,8 +162,8 @@ void yajl_string_decode(yajl_buf buf, const unsigned char * str,
|
|
162
162
|
end+=3;
|
163
163
|
/* check if this is a surrogate */
|
164
164
|
if ((codepoint & 0xFC00) == 0xD800) {
|
165
|
-
end
|
166
|
-
|
165
|
+
if (end + 2 < len && str[end + 1] == '\\' && str[end + 2] == 'u') {
|
166
|
+
end++;
|
167
167
|
unsigned int surrogate = 0;
|
168
168
|
hexToDigit(&surrogate, str + end + 2);
|
169
169
|
codepoint =
|
data/lib/yajl/bzip2.rb
CHANGED
data/lib/yajl/http_stream.rb
CHANGED
@@ -4,6 +4,7 @@ require 'socket'
|
|
4
4
|
require 'yajl'
|
5
5
|
require 'yajl/version' unless defined? Yajl::VERSION
|
6
6
|
require 'uri'
|
7
|
+
require 'cgi'
|
7
8
|
|
8
9
|
module Yajl
|
9
10
|
# This module is for making HTTP requests to which the response bodies (and possibly requests in the near future)
|
@@ -101,7 +102,7 @@ module Yajl
|
|
101
102
|
default_headers["Content-Type"] = opts["Content-Type"] || "application/x-www-form-urlencoded"
|
102
103
|
body = opts.delete(:body)
|
103
104
|
if body.is_a?(Hash)
|
104
|
-
body = body.keys.collect {|param| "#{
|
105
|
+
body = body.keys.collect {|param| "#{CGI.escape(param.to_s)}=#{CGI.escape(body[param].to_s)}"}.join('&')
|
105
106
|
end
|
106
107
|
default_headers["Content-Length"] = body.length
|
107
108
|
end
|
@@ -161,7 +162,7 @@ module Yajl
|
|
161
162
|
if block_given?
|
162
163
|
chunkLeft = 0
|
163
164
|
while !socket.eof? && (line = socket.gets)
|
164
|
-
break if line.match
|
165
|
+
break if line.match(/^0.*?\r\n/)
|
165
166
|
next if line == "\r\n"
|
166
167
|
size = line.hex
|
167
168
|
json = socket.read(size)
|
data/lib/yajl/version.rb
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
3
3
|
|
4
4
|
describe "One-off JSON examples" do
|
5
|
+
it "should not blow up with a bad surrogate trailer" do
|
6
|
+
# https://github.com/brianmario/yajl-ruby/issues/176
|
7
|
+
bad_json = "{\"e\":{\"\\uD800\\\\DC00\":\"a\"}}"
|
8
|
+
|
9
|
+
Yajl::Parser.new.parse(bad_json)
|
10
|
+
end
|
11
|
+
|
5
12
|
it "should parse 23456789012E666 and return Infinity" do
|
6
13
|
infinity = (1.0/0)
|
7
14
|
silence_warnings do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yajl-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
248
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.6.
|
249
|
+
rubygems_version: 2.6.11
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: Ruby C bindings to the excellent Yajl JSON stream-based parser library.
|