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

read_segment_from_words bounds check overly restrictive #148

Closed
bspeice opened this issue Sep 27, 2019 · 2 comments
Closed

read_segment_from_words bounds check overly restrictive #148

bspeice opened this issue Sep 27, 2019 · 2 comments

Comments

@bspeice
Copy link
Contributor

bspeice commented Sep 27, 2019

Related to #101, but slightly different. When reading in messages from a network buffer (or mmap file in #121), it happens frequently that the message buffer is significantly larger than the message itself. When callingread_message_from_words, there's a length check that errors out in this situation. While I'm happy to pass read_message the correct-size buffer, that requires me to read the segment table to figure out message size, and read_segment_table is private.

To better support streaming use cases, is it possible to either allow the length check to succeed if too many words are supplied, or move read_segment_table to the public API?

Side note: if a decision is made to mark read_segment_table as public, having an additional method to actually calculate message size would be incredibly helpful. I was able to guess and check, but having an approved means would be great.

@dwrensha
Copy link
Member

Good point!

Fixed in 13632f8.

@dwrensha
Copy link
Member

I also opened #149.

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