Skip to content

Commit ba80d62

Browse files
committed
throws errors if map object is too large (size > 2**32)
1 parent a27913a commit ba80d62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Encoder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ export class Encoder {
217217
// map 32
218218
this.writeU8(0xdf);
219219
this.writeU32(size);
220+
} else {
221+
throw new Error(`Too large map object: ${size}`);
220222
}
221223
for (const key of keys) {
222224
this.encodeString(key);

0 commit comments

Comments
 (0)