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

pnet_macros: Fix handle_vec_primitive for multi byte primitives #596

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

jefftt
Copy link
Contributor

@jefftt jefftt commented Jan 11, 2023

Currently get_*() will panic for primitives larger than 1 byte with an array out of bounds, e.g. u32be because it will try to push for vec.capacity() times which is set to the number of bytes in the vec. The correct times to push is the number of elements, which is the number of bytes divided by the size.

@mrmonday
Copy link
Contributor

Looks good, thanks!

@mrmonday mrmonday merged commit 84d6cb6 into libpnet:master Jan 27, 2023
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.

None yet

2 participants