Skip to content

Comments

fix(storage): use u8 for NippyJar's DataReader::offset_size#8360

Merged
mattsse merged 1 commit intomainfrom
fgimenez/nippyjar-reader-offset-size-u8
May 23, 2024
Merged

fix(storage): use u8 for NippyJar's DataReader::offset_size#8360
mattsse merged 1 commit intomainfrom
fgimenez/nippyjar-reader-offset-size-u8

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
@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