Closed
Description
decode()
throws RangeError on empty Uint8Array
steps to reproduce
const { decode } = require("@msgpack/msgpack");
decode(new Uint8Array());
expected result
hmm hard to tell, maybe null
or undefined
.
decode(encode());
returns null
actual result
Uncaught RangeError: Offset is outside the bounds of the DataView
at DataView.getUint8 (<anonymous>)
at Decoder.readU8 (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:532:33)
at Decoder.readHeadByte (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:425:34)
at Decoder.doDecodeSync (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:169:35)
at Decoder.decode (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/Decoder.js:89:29)
at decode (/home/kuba/tmp_/node_modules/@msgpack/msgpack/dist/decode.js:14:20)
Metadata
Metadata
Assignees
Labels
No labels