Ensure binary data is read to end #36

Open
opened 2023-02-25 13:56:48 +01:00 by lucas · 0 comments
Owner

#28 (comment) (link to one comment) was caused by missing a single byte value in the binary format of .package files.
To avoid things like that in the future, it would be helpful to have a way to ensure that whenever binary data of a fixed size (e.g. for a file type) is read, there is a final check that the end has been reached.

It doesn't prevent reading of partially known data, as you can just seek deliberately. But it does prevent accidentally not reading parts of it, and end up in the same situation as above.

https://git.sclu1034.dev/bitsquid_dt/dtmt/issues/28#issuecomment-544 (link to one comment) was caused by missing a single byte value in the binary format of `.package` files. To avoid things like that in the future, it would be helpful to have a way to ensure that whenever binary data of a fixed size (e.g. for a file type) is read, there is a final check that the end has been reached. It doesn't prevent reading of partially known data, as you can just seek deliberately. But it does prevent accidentally not reading parts of it, and end up in the same situation as above.
lucas added the
kind
enhancement
crate/sdk
stage
actionable
labels 2023-02-25 13:56:48 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: bitsquid_dt/dtmt#36
No description provided.