Skip to content

Prevent crash when custom streambuf implementation throws - #1358

Merged
Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:masterfrom
Arzaghi:Fix_Issue1105
Nov 6, 2020
Merged

Prevent crash when custom streambuf implementation throws#1358
Stephan T. Lavavej (StephanTLavavej) merged 5 commits into
microsoft:masterfrom
Arzaghi:Fix_Issue1105

Conversation

@Arzaghi

@Arzaghi Hamid Reza Arzaghi (Arzaghi) commented Oct 8, 2020

Copy link
Copy Markdown
Contributor

Fixes #1105
Just pre-init some pointers and a numeric variable and also wrapping a pointer deletion with an if statement could solve the issue.
I wanted to add a test coverage and I didn't find any relative place to add the test. I've added a new folder for the new test. It's my first time that I'm adding a new folder to the tests folder. I've tried to follow the conventions. Excuse me if I missed anything here.

@Arzaghi Hamid Reza Arzaghi (Arzaghi) changed the title prevent Crash when custom streambuf implementation throws Prevent crash when custom streambuf implementation throws Oct 8, 2020
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the bug Something isn't working label Oct 9, 2020
@Arzaghi
Hamid Reza Arzaghi (Arzaghi) marked this pull request as ready for review October 9, 2020 15:03
@Arzaghi
Hamid Reza Arzaghi (Arzaghi) requested a review from a team as a code owner October 9, 2020 15:03

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with suggested changes

Comment thread tests/std/tests/GH_001105_streambuf/test.cpp Outdated
Comment thread stl/inc/xiosbase
Comment thread stl/inc/xiosbase

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for fixing this bug! I'm planning to prepare a batch of PRs for merging, so I'll validate minor changes and push them in a few minutes.

Comment thread stl/inc/xiosbase
Comment thread stl/inc/xiosbase
Comment thread stl/src/ios.cpp Outdated
Comment thread tests/std/test.lst Outdated
Comment thread tests/std/tests/GH_001105_streambuf/test.cpp Outdated
Comment thread tests/std/tests/GH_001105_streambuf/test.cpp Outdated
Comment thread tests/std/tests/GH_001105_streambuf/test.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

FYI Charlie Barto (@barcharcraz), I pushed small changes after you approved.

@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks again - we really appreciate all of your fixes! 🐈

@Arzaghi
Hamid Reza Arzaghi (Arzaghi) deleted the Fix_Issue1105 branch November 6, 2020 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash if custom std::streambuf implementation throws

3 participants