Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in unpackMultiple with bundleStrings: true #84

Open
yume-chan opened this issue Oct 6, 2022 · 1 comment
Open

Infinite loop in unpackMultiple with bundleStrings: true #84

yume-chan opened this issue Oct 6, 2022 · 1 comment

Comments

@yume-chan
Copy link

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

@kriszyp
Copy link
Owner

kriszyp commented Nov 13, 2022

This fix should be published in v1.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants