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

stack corruption for long cmdline args #78

Merged
merged 1 commit into from
Oct 23, 2022
Merged

stack corruption for long cmdline args #78

merged 1 commit into from
Oct 23, 2022

Conversation

chipweinberger
Copy link
Contributor

@chipweinberger chipweinberger commented Oct 20, 2022

dest++;

/* concat src string to dest string */
while (dest < end && *src != 0)
while (dest < end-1 && *src != 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

end is past the end of the buffer. end = dest + buffer_size.

i.e. if end is 0x05, the last time would should enter the loop (& increment dest) is when dest is 0x03.

last iteration: 0x03 < 0x04 -> dest will become 0x04

@tomghuang tomghuang merged commit f25c624 into argtable:master Oct 23, 2022
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