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 conversions for 32bit size_t #24

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Conversation

RichLogan
Copy link
Contributor

@RichLogan RichLogan commented Mar 12, 2024

When compiling for 32 bit, we have some warnings about unsafe casts, primarily because we use gs::VarUint unwrapping to std::uint64_t as inputs for std::size_ts. This ensures deserialize/decodes on 32 bit platforms will safely bail if it receives objects with lengths > than it's std::size_t::max

Copy link

@GhostofCookie GhostofCookie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing a lot of copy paste but in general I see no errors with this (assuming limiting to 32bit is what is desired).

src/gs_decoder.cpp Outdated Show resolved Hide resolved
src/gs_decoder.cpp Outdated Show resolved Hide resolved
src/gs_decoder.cpp Outdated Show resolved Hide resolved
@RichLogan RichLogan requested a review from GhostofCookie March 20, 2024 09:35
@RichLogan RichLogan merged commit 57266d8 into cisco:main Mar 22, 2024
3 checks passed
@RichLogan RichLogan deleted the fix-32bit-warnings branch March 22, 2024 07:39
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.

2 participants