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(storage): use u8 for NippyJar's DataReader::offset_size #8360

Merged
merged 1 commit into from
May 23, 2024

Conversation

fgimenez
Copy link
Member

The size of an offset for NippyJar's DataReader is at most 8 bytes and we are using a u64 field for it. Besides being bigger than needed, there are unnecessary downcasts to usize that could also be potentially lossy.

In this PR the type of offset_size is set to u8 and there are non-lossy type casts to usize and u64 where needed.

@fgimenez fgimenez added A-static-files Related to static files C-security Issue or pull request related to security. and removed A-static-files Related to static files labels May 23, 2024
@DaniPopes DaniPopes changed the title fix(storage): use u8 for NippiJar's DataReader::offset_size fix(storage): use u8 for NippyJar's DataReader::offset_size May 23, 2024
@mattsse mattsse merged commit c5bc960 into main May 23, 2024
26 of 30 checks passed
@mattsse mattsse deleted the fgimenez/nippyjar-reader-offset-size-u8 branch May 23, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-static-files Related to static files C-security Issue or pull request related to security.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants