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

Resize vector holding ip address to correct size #88

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Resize vector holding ip address to correct size #88

merged 1 commit into from
Aug 28, 2024

Conversation

jmccl
Copy link
Contributor

@jmccl jmccl commented Aug 23, 2024

Trivial change to resize the vector holding the ip address to the correct size. Without this the subsequent call to 'from_utf8' operates on a vector that is too large, resulting in garbage at the end of the string produced.

@bavshin-f5
Copy link
Collaborator

The change is correct, but not sufficient. If you do that, NgxHttpOrigDstCtx::save will attempt to copy IPV4_STRLEN bytes from the addr of length e, going past the end of the buffer.

@jmccl
Copy link
Contributor Author

jmccl commented Aug 27, 2024

Good catch. I've updated the PR.

Copy link
Collaborator

@bavshin-f5 bavshin-f5 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Do you mind squashing the commits and adding fix(examples): prefix.

@jmccl
Copy link
Contributor Author

jmccl commented Aug 28, 2024

Done.

@bavshin-f5 bavshin-f5 merged commit 3aedd7c into nginxinc:master Aug 28, 2024
@bavshin-f5
Copy link
Collaborator

Thanks!

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