From cac24c9caa59896a9731dd1ec0af2ab93ad124da Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 18 Nov 2023 06:32:08 -0500 Subject: [PATCH] fix: unpack int checks missing possible types --- src/serialization/unpack.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/serialization/unpack.ts b/src/serialization/unpack.ts index a85f691..c54593f 100644 --- a/src/serialization/unpack.ts +++ b/src/serialization/unpack.ts @@ -166,7 +166,18 @@ export default class Unpacker { private _unpack(): any { const b = this._d.getUint8(this._offset); - if (b <= 0x7f || (b >= 0xe0 && b <= 0xff)) { + if ( + b <= 0x7f || + b >= 0xe0 || + b === 0xcc || + b === 0xcd || + b === 0xce || + b === 0xcf || + b === 0xd0 || + b === 0xd1 || + b === 0xd2 || + b === 0xd3 + ) { return this.unpackInt(); } else if (b === 0xc2 || b === 0xc3 || b === 0xc0) { return this.unpackBool();