Skip to content

fix: possible infinite loop when parsing option#1923

Merged
alexander-fenster merged 1 commit intomasterfrom
options-parse
Aug 21, 2023
Merged

fix: possible infinite loop when parsing option#1923
alexander-fenster merged 1 commit intomasterfrom
options-parse

Conversation

@alexander-fenster
Copy link
Copy Markdown
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