-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48311: [C++] Fix OOB memory access in buffered IO #48322
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
base: main
Are you sure you want to change the base?
Conversation
|
|
|
@wgtmac Hi, I don't know who to ping, so I chose you since you’ve looked at one of my reviews. Can you suggest the right person to call to review this? This bug is really annoying and appears very randomly (and looks like a corrupted allocator, so it's hard to debug). |
|
cc @mapleFU |
| // No need to reserve space for more than the total remaining number of bytes. | ||
| if (bytes_buffered_ == 0) { | ||
| // Special case: we can not keep the current buffer because it does not | ||
| // Special case: we can override data in the current buffer because it does not |
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.
Can you rewrite comment in SetBufferSize? Since buffer_pos_ would be rewritten now
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.
Missed that comment, thanks, fixed
Rationale for this change
Fixing: #48311
What changes are included in this PR?
Applied fix from #48311 and added test
Are these changes tested?
Yes, added test, without my patch test fails with debug check:
Are there any user-facing changes?
No, this PR fixes a bug