bson_ext 1.11.1 → 1.12.0.rc0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1adf4cc8e415e8905f01a81bb7a843cc480e0718
4
- data.tar.gz: 4fc4a02485a5732bbc114186a6187d8e0ded4e7c
3
+ metadata.gz: 8ede4a862a8b13bc7743995f8985868dd0f2a453
4
+ data.tar.gz: 9764114e6d4949ac5c8210ace6a47f96f3830696
5
5
  SHA512:
6
- metadata.gz: 19e73866ad7299986a2ecb705de815d9074be2c903000b7c04b44a4e901c3810078b07f1137ebc84966b0ec4fd32ce1cc2a6a1dbc37f0d6c13943c62b34d27f0
7
- data.tar.gz: 7a8a5c6c39a00b27a929eadbf06753785b7f0dc03fe713409532f3024be0284860951e933fd36e21b7de1618d3dee0bff67ab7d9d61d221595c672436bd65bea
6
+ metadata.gz: 3ba2674d1f55fb5f6ba7596b68f8707cd085b0246fffbecd83c2d07b3b499f9d45567f38a89b53a45d513aef270f818d0c2880b91926d8fec5a007cd26f30b72
7
+ data.tar.gz: c3e067558e41f6027d5a9ded5aa9b53a4fdbcb799df80d3756651140348c050f02ee612b5a77d9298e9c06a0522ea4a26bfcc3b6133bf4009465fd12cf8852bf
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- xןA���(\/J��bR/�dI��N�� p�hRu,��,�$>x�:�g��ΌR���%h�ãCc�������~H�|�ux�УbE��0��^Dȩ_ w�-���?~��Np�����l����1A���-ky*O^8(��U|�-��M�8��ݽ�Q�ɧ�oӅȐ�$.TL[+���{0^$|>b*T�.loT�V�d&����_r���3�?z�o�t3�3O7�^Le袚�㹩�G�
1
+ V��ߴ�?��a�Sk����{=*�|PCL�b���k��5K��NaC��rh�~�t�f�G�B֐6n%�u��sp�5L/��XuZ����3��Ζ�s�O�7���X/C��4��Jq0�B�%��ߌ<{�.]0x}��Q�(�B"Re� W�-���
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- }������Օ�ؖ�"fg����͛��6�az��3_
2
- �#��-}zeUI *��\;��?X�1i�)�rFiӳ��)��I�xF�����,�u����E|}���Z�s>+���yT������)'_8a��J�rJ5͊�q� W��#��
1
+ �̌^��u�ҜZ�6O�+NM�$��+��o�K�C��TЎ���P+U��v
2
+ Z�a ��C����ÁW��gXu
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.11.1
1
+ 1.12.0.rc0
data/ext/cbson/cbson.c CHANGED
@@ -151,8 +151,6 @@ static void write_utf8(bson_buffer_t buffer, VALUE string, int allow_null) {
151
151
  #define EXTENDED RE_OPTION_EXTENDED
152
152
  #endif
153
153
 
154
- /* TODO we ought to check that the malloc or asprintf was successful
155
- * and raise an exception if not. */
156
154
  /* TODO maybe we can use something more portable like vsnprintf instead
157
155
  * of this hack. And share it with the Python extension ;) */
158
156
  /* If we don't have ASPRINTF, there are two possibilities:
@@ -164,6 +162,9 @@ static void write_utf8(bson_buffer_t buffer, VALUE string, int allow_null) {
164
162
  { \
165
163
  int vslength = _scprintf("%d", i) + 1; \
166
164
  *buffer = malloc(vslength); \
165
+ if (buffer == NULL) { \
166
+ rb_raise(rb_eNoMemError, "failed to allocate memory in INT2STRING"); \
167
+ } \
167
168
  _snprintf(*buffer, vslength, "%d", i); \
168
169
  }
169
170
  #define FREE_INTSTRING(buffer) free(buffer)
@@ -171,13 +172,22 @@ static void write_utf8(bson_buffer_t buffer, VALUE string, int allow_null) {
171
172
  #define INT2STRING(buffer, i) \
172
173
  { \
173
174
  int vslength = snprintf(NULL, 0, "%d", i) + 1; \
174
- *buffer = malloc(vslength); \
175
- snprintf(*buffer, vslength, "%d", i); \
175
+ *buffer = malloc(vslength); \
176
+ if (buffer == NULL) { \
177
+ rb_raise(rb_eNoMemError, "failed to allocate memory in INT2STRING"); \
178
+ } \
179
+ snprintf(*buffer, vslength, "%d", i); \
176
180
  }
177
181
  #define FREE_INTSTRING(buffer) free(buffer)
178
182
  #endif
179
183
  #else
180
- #define INT2STRING(buffer, i) asprintf(buffer, "%d", i);
184
+ #define INT2STRING(buffer, i) \
185
+ { \
186
+ int length = asprintf(buffer, "%d", i); \
187
+ if (length == -1) { \
188
+ rb_raise(rb_eNoMemError, "failed to allocate memory in INT2STRING"); \
189
+ } \
190
+ }
181
191
  #ifdef USING_SYSTEM_ALLOCATOR_LIBRARY /* Ruby Enterprise Edition with tcmalloc */
182
192
  #define FREE_INTSTRING(buffer) system_free(buffer)
183
193
  #else
@@ -974,7 +984,7 @@ static VALUE method_deserialize(VALUE self, VALUE bson, VALUE opts) {
974
984
  struct deserialize_opts deserialize_opts;
975
985
 
976
986
  deserialize_opts.compile_regex = 1;
977
- if (rb_funcall(opts, rb_intern("has_key?"), 1, ID2SYM(rb_intern("compile_regex"))) == Qtrue &&
987
+ if (rb_funcall(opts, rb_intern("has_key?"), 1, ID2SYM(rb_intern("compile_regex"))) == Qtrue &&
978
988
  rb_hash_aref(opts, ID2SYM(rb_intern("compile_regex"))) == Qfalse) {
979
989
  deserialize_opts.compile_regex = 0;
980
990
  }
data/ext/cbson/version.h CHANGED
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- #define VERSION "1.11.1"
17
+ #define VERSION "1.12.0.rc0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bson_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.12.0.rc0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily Stolfo
@@ -34,7 +34,7 @@ cert_chain:
34
34
  JrZM8w8wGbIOeLtoQqa7HB/jOYbTahH7KMNh2LHAbOR93hNIJxVRa4iwxiMQ75tN
35
35
  9WUIAJ4AEtjwRg1Bz0OwDo3aucPCBpx77+/FWhv7JYY=
36
36
  -----END CERTIFICATE-----
37
- date: 2014-09-15 00:00:00.000000000 Z
37
+ date: 2014-11-18 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: bson
@@ -42,14 +42,14 @@ dependencies:
42
42
  requirements:
43
43
  - - "~>"
44
44
  - !ruby/object:Gem::Version
45
- version: 1.11.1
45
+ version: 1.12.0.rc0
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 1.11.1
52
+ version: 1.12.0.rc0
53
53
  description: C extensions to accelerate the Ruby BSON serialization. For more information
54
54
  about BSON, see http://bsonspec.org. For information about MongoDB, see http://www.mongodb.org.
55
55
  email: mongodb-dev@googlegroups.com
@@ -85,9 +85,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - ">"
89
89
  - !ruby/object:Gem::Version
90
- version: '0'
90
+ version: 1.3.1
91
91
  requirements: []
92
92
  rubyforge_project: bson_ext
93
93
  rubygems_version: 2.2.2
metadata.gz.sig CHANGED
Binary file