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

fix: possible infinite loop when parsing option #1923

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

alexander-fenster
Copy link
Contributor

@alexander-fenster alexander-fenster commented Aug 17, 2023

The while loop in parseOptionValue can be infinite if the closing brace } it expects never comes.

const protobuf = require('protobufjs');
protobuf.parse("option (foo).whatever = {");

Reported by @oetr.

Minor unrelated changes also in this PR, because I'm too lazy to create a separate one:

  • changed eslint-disable-line to a proper eslint-disable-next-line in a few places to fix linting errors;
  • removed extra logging in one of the tests.

@alexander-fenster alexander-fenster requested a review from bcoe August 17, 2023 21:10
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

Successfully merging this pull request may close these issues.

2 participants