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 +4 -4
- data/ChangeLog +5 -0
- data/ext/java/org/msgpack/jruby/Decoder.java +13 -6
- data/lib/msgpack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65e7539211e49d3c0eeef7b22f588fc111cf0d3574a6f204e950ced43addc51a
|
|
4
|
+
data.tar.gz: 3fa655fa372b102bd136d0cf61c84f68bd4d9e0836cb14891d95bc2c239f0b01
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
146
|
+
array.push(next());
|
|
143
147
|
}
|
|
144
|
-
return
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
data/lib/msgpack/version.rb
CHANGED