Skip to content

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
Member

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
Member

@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 nginx:master Aug 28, 2024
@bavshin-f5
Copy link
Member

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