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(server): Panic when last envelope item is empty #894

Merged
merged 2 commits into from
Dec 23, 2020

Conversation

jan-auer
Copy link
Member

Trailing newlines can be omitted in envelopes. When the last envelope item was
empty, the parsing code could yield two invalid results:

  • If an explicit length of 0 was specified, then the envelope was rejected
    with UnexpectedEof.
  • If implicit length was used, the parser would panic.

This can both be solved by aligning the parse offset with the end of the buffer.

@jan-auer jan-auer requested review from a team and tonyo December 23, 2020 12:24
@jan-auer jan-auer self-assigned this Dec 23, 2020
@jan-auer
Copy link
Member Author

This patch qualifies as critical fix as it resolves a production panic, and is approved for merge during code freeze.

@jan-auer jan-auer changed the title fix: Panic when last envelope item is empty fix(server): Panic when last envelope item is empty Dec 23, 2020
@jan-auer jan-auer merged commit ef7699b into master Dec 23, 2020
@jan-auer jan-auer deleted the fix/envelope-eof-panic branch December 23, 2020 12:46
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.

3 participants