bson 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bson might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ac84fbcc70f8632f4307aad22bd38d33d03c0a0
4
- data.tar.gz: e15158b63b32006e7ed77bde63daac6aa4931637
3
+ metadata.gz: e6ad453f095cb79d3aaf2fdd4b9d4cd12d169678
4
+ data.tar.gz: d29d2f0b0fd25f0d3ca9f83913e9a7099b43e780
5
5
  SHA512:
6
- metadata.gz: 8b19fa4b7b1de4a48e4bb616812be5c2a3bca4691cfea5b229554ef2f8ca0ca62d788973afe38cc6bbfd4e7ef8e8a6f6acf00198ed097d5b5d268bc152468ae8
7
- data.tar.gz: 89f2ff69f1f03dc7bb78213be4addbd06053339b53b17364181810e23e3fadd2cacaa236da296af9eda6ed7047042d5be3187f77da87e06713f896b5779891af
6
+ metadata.gz: bd903a7e666a27c16591d9207b90eecf16a9854371148e7c8cdc53d6bdf8a1e510ccd68ea5e455a54b4d6e66f39ef3e9292d1cbc6fb213bbc8cefba6f000adf2
7
+ data.tar.gz: 8d8a8546d7beabdcbd0d11b95b37cc4aafe1b76649d9a2beeb1040a9cda741ddc7435c9c811a096d76348a51b4f1570b144c7d170edee73e896ecdb5d4181e33
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,13 @@
1
1
  BSON Changelog
2
2
  ==============
3
3
 
4
+ ## 3.0.3
5
+
6
+ ### Bug Fixes
7
+
8
+ * [#31](https://github.com/mongodb/bson-ruby/pull/31) Fix Int64 decode from strings.
9
+ (Nobuyoshi Nakada)
10
+
4
11
  ## 3.0.2
5
12
 
6
13
  ### Bug Fixes
@@ -210,7 +210,7 @@ static VALUE rb_float_from_bson_double(VALUE self, VALUE value)
210
210
  {
211
211
  const char * bytes;
212
212
  double v;
213
- bytes = RSTRING_PTR(value);
213
+ bytes = StringValuePtr(value);
214
214
  memcpy(&v, bytes, RSTRING_LEN(value));
215
215
  return DBL2NUM(v);
216
216
  }
@@ -358,7 +358,7 @@ static VALUE rb_integer_to_bson_key(int argc, VALUE *argv, VALUE self)
358
358
  */
359
359
  static VALUE rb_integer_from_bson_int32(VALUE self, VALUE bson)
360
360
  {
361
- const uint8_t *v = (const uint8_t*) RSTRING_PTR(bson);
361
+ const uint8_t *v = (const uint8_t*) StringValuePtr(bson);
362
362
  const int32_t integer = v[0] + (v[1] << 8) + (v[2] << 16) + (v[3] << 24);
363
363
  return INT2NUM(integer);
364
364
  }
@@ -381,7 +381,7 @@ static int64_t rb_bson_to_int64_t(VALUE bson)
381
381
  uint32_t byte_0, byte_1;
382
382
  int64_t byte_2, byte_3;
383
383
  int64_t lower, upper;
384
- v = (uint8_t*) RSTRING_PTR(bson);
384
+ v = (uint8_t*) StringValuePtr(bson);
385
385
  byte_0 = v[0];
386
386
  byte_1 = v[1];
387
387
  byte_2 = v[2];
@@ -457,7 +457,7 @@ static VALUE int64_t_to_bson(int64_t v, VALUE encoded)
457
457
  */
458
458
  static VALUE rb_integer_to_bson_int64(VALUE self, VALUE encoded)
459
459
  {
460
- return int64_t_to_bson(NUM2INT64(self), encoded);
460
+ return int64_t_to_bson(NUM2INT64(self), StringValue(encoded));
461
461
  }
462
462
 
463
463
  /**
@@ -529,6 +529,7 @@ static VALUE rb_string_set_int32(VALUE str, VALUE pos, VALUE an_int32)
529
529
  (v >> 16) & 255,
530
530
  (v >> 24) & 255
531
531
  };
532
+ rb_str_modify(str);
532
533
  if (offset < 0 || offset + 4 > RSTRING_LEN(str)) {
533
534
  rb_raise(rb_eArgError, "invalid position");
534
535
  }
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module BSON
16
- VERSION = "3.0.2"
16
+ VERSION = "3.0.3"
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Brock
@@ -34,7 +34,7 @@ cert_chain:
34
34
  XZOS48LlWh15EG4yZo/gRzqNAW2LUIkYA5eMS2Kp6r+KV8IBUO/LaHdrXbdilpa8
35
35
  BRsuCo7UZDbFVRns04HLyjVvkj+K/ywIcdKdS0csz5M=
36
36
  -----END CERTIFICATE-----
37
- date: 2015-04-23 00:00:00.000000000 Z
37
+ date: 2015-05-19 00:00:00.000000000 Z
38
38
  dependencies: []
39
39
  description: A full featured BSON specification implementation, in Ruby
40
40
  email:
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: 1.3.6
137
137
  requirements: []
138
138
  rubyforge_project: bson
139
- rubygems_version: 2.4.5
139
+ rubygems_version: 2.4.6
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Ruby Implementation of the BSON specification
metadata.gz.sig CHANGED
Binary file