msgpack 1.8.6 → 1.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc5fdca2a5a867c26e72649de9838ca9a7ee44e2e84d295215207edaa98d3629
4
- data.tar.gz: 703a7d56d9d634b53020db638e578339296e6a9cbc3da0ee6d3c8efa7d5d58bb
3
+ metadata.gz: 65e7539211e49d3c0eeef7b22f588fc111cf0d3574a6f204e950ced43addc51a
4
+ data.tar.gz: 3fa655fa372b102bd136d0cf61c84f68bd4d9e0836cb14891d95bc2c239f0b01
5
5
  SHA512:
6
- metadata.gz: d06ef9b19f1d8e3d18eb2bc05ed5cd26102bdd0cb60d1d8ac622d122da1d734cc2c17180f4b9c0fd75d093f0829ebd38ecab4f3a685d0cb3653a20cf5bbd78c4
7
- data.tar.gz: d5f57a80f7a109703629c1965d87638675b478ca0f34ac8421836fbadde433cd108185094326cff0a4b9c7d59f53d07904a4569e9549ca6a500f0309ae58048a
6
+ metadata.gz: 8588f17a3fa9eec124a7ef874322fcf1aa90318cda81e463f3b7186267b3c82ec3ecf6fdd514a9d265cb40d781b7718551aa8278be25540fc9aaaaec085e851b
7
+ data.tar.gz: b224acfb0d31868e42e684e1263b11fed097054a359fc3437e1185130874e5f635dbb386b43b509b84c99caae86799dbf9517fc1e4ad5849788d824dab47699c
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026-10-30 1.8.7
2
+
3
+ * Fix the Java version of the unpacker to never preallocate objects larger than
4
+ the buffered size (similar to the fix for the C unpacker in 1.8.1).
5
+
1
6
  2026-10-27 1.8.6
2
7
 
3
8
  * Fix use-after-free when a recursive extension proc rescues, skips or resets.
@@ -137,11 +137,15 @@ public class Decoder implements Iterator<IRubyObject> {
137
137
  }
138
138
 
139
139
  private IRubyObject consumeArray(int size) {
140
- IRubyObject[] elements = new IRubyObject[size];
140
+ int preallocatedSize = size;
141
+ if (preallocatedSize > buffer.remaining()) {
142
+ preallocatedSize = buffer.remaining();
143
+ }
144
+ RubyArray array = runtime.newArray(preallocatedSize);
141
145
  for (int i = 0; i < size; i++) {
142
- elements[i] = next();
146
+ array.push(next());
143
147
  }
144
- return runtime.newArray(elements);
148
+ return array;
145
149
  }
146
150
 
147
151
  private IRubyObject consumeHash(int size) {
@@ -184,9 +188,12 @@ public class Decoder implements Iterator<IRubyObject> {
184
188
  }
185
189
 
186
190
  private byte[] readBytes(int size) {
187
- byte[] payload = new byte[size];
188
- buffer.get(payload);
189
- return payload;
191
+ if (buffer.remaining() >= size) {
192
+ byte[] payload = new byte[size];
193
+ buffer.get(payload);
194
+ return payload;
195
+ }
196
+ throw new BufferUnderflowException();
190
197
  }
191
198
 
192
199
  @Override
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
- VERSION = "1.8.6"
2
+ VERSION = "1.8.7"
3
3
  # Note for maintainers:
4
4
  # Don't miss building/releasing the JRuby version (rake buld:java)
5
5
  # See "How to build -java rubygems" in README for more details.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi