msgpackr icon indicating copy to clipboard operation
msgpackr copied to clipboard

Infinite loop in `unpackMultiple` with `bundleStrings: true`

Open yume-chan opened this issue 1 year ago • 1 comments

Repro:

const { Packr } = require('msgpackr')

const options = {
  bundleStrings: true,
  sequential: true,
};

const packer = new Packr(options);
const unpacker = new Packr(options);

const data = { data: 42 }; // key length >= 4

unpacker.unpackMultiple(Buffer.concat([
  packer.pack(data),
  packer.pack(data)
]));

It never finishes and the memory usage continues growing, eventually it runs out of memory.

msgpackr version: 1.7.2 Node version: 16.15.1

yume-chan avatar Oct 06 '22 08:10 yume-chan