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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 731d0a5e71e781ff6061f6fda922f73c773ad0ee
4
- data.tar.gz: c3a1f37875013458989cf34988bed786d58c7c00
3
+ metadata.gz: 2211f169082b89b1385a841f79d445cd559b405c
4
+ data.tar.gz: 9074ca9bab2acf80a0a7069f2a608ee958b2eea8
5
5
  SHA512:
6
- metadata.gz: 33df12d70c43f4599438ce478755967d174ce403fddc946dd5b5ca2e76723ba064fc10bb1185513927a230bdbbf2ebe479d1666632127bfcd4afe367ea24e646
7
- data.tar.gz: 2d78f6564a3c14a17fc55187a1951b5a5fa2b263dff0f47fd8d6d6d377727771989bdcb9b68970b5995fb53449e0d4053cffc96412820525dec184074e68225c
6
+ metadata.gz: 20f296b807da6097dec709b153364def6cae62187223e64027871103261800e8edda82d5d2bfe96a9dbfb3e29a6b84f56e39c09b45d3bafd423335e86aa52186
7
+ data.tar.gz: 89bee3f6029488f771d15a4ebc9e910a8c1ca7d276ef5ad001bb118e7754397bfb4a4065cf5a8b8cc5edffe222bdb669742b6cbe9c6572d3656b3d683393c2b8
@@ -1,14 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
6
3
  - 2.0.0
7
4
  - 2.1
8
- - rbx-2
9
- - ree
5
+ - 2.2
6
+ - 2.3
7
+ - 2.4.1
10
8
  - ruby-head
11
9
  before_install: gem install bundler --no-document
12
- matrix:
13
- allow_failures:
14
- - rvm: rbx-2
@@ -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
- if (str[end] == '\\' && str[end + 1] == 'u') {
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 =
@@ -6,6 +6,6 @@ begin
6
6
  require 'bzip2' unless defined?(Bzip2)
7
7
  require 'yajl/bzip2/stream_reader.rb'
8
8
  require 'yajl/bzip2/stream_writer.rb'
9
- rescue LoadError => e
9
+ rescue LoadError
10
10
  raise "Unable to load the bzip2 library. Is the bzip2-ruby gem installed?"
11
- end
11
+ end
@@ -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| "#{URI.escape(param.to_s)}=#{URI.escape(body[param].to_s)}"}.join('&')
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 /^0.*?\r\n/
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)
@@ -1,3 +1,3 @@
1
1
  module Yajl
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
@@ -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.0
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: 2016-11-01 00:00:00.000000000 Z
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.3
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.