-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
[Argtable3] stack corruption for long arguments (IDFGH-8566) #10016
[Argtable3] stack corruption for long arguments (IDFGH-8566) #10016
Conversation
770b7fd
to
3df5050
Compare
dest++; | ||
|
||
/* concat src string to dest string */ | ||
while (dest < end && *src != 0) | ||
while (dest < (end-1) && *src != 0) | ||
*dest++ = *src++; |
There was a problem hiding this comment.
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
Thanks for the fix @chipweinberger! |
3df5050
to
7915973
Compare
@chipweinberger : Thanks for the PR. I'll review it as soon as possible. @igrr : After reviewing and merging this patch, I'll create a new release, since this fix is critical. I'll let you know when the release is ready. |
Appreciate your service! |
@tomghuang Thank you for accepting the PR and making the release! @chipweinberger Thank you for your contribution! We'll upgrade argtable to the new release soon. |
✅ EDIT: MERGED into argtable directly: argtable/argtable3@f25c624 ✅
For large command line arguments, 200 chars or greater, arg_cat writes out of bounds.