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

Add a null-pointer check before processing base::SupportsUserData::GetUserData #10676

Merged
merged 1 commit into from Oct 3, 2017

Conversation

Projects
None yet
3 participants
@qazbnm456
Contributor

qazbnm456 commented Oct 3, 2017

As #10429 got merged in Electron v1.8.x, I've discovered that we didn't check if wrapped is a valid object or not here.
This will then cause the Electron to crash if the wrapped object doesn't belong to a valid memory we can touch.

In this PR, I've added a check before calling the SupportsUserData::GetUserData function and also modified the code of TrackableObjectBase::AttachAsUserData to call from SupportsUserData with std::unique_ptr rather than raw-pointer as suggested here.

Thanks!

@qazbnm456 qazbnm456 requested a review from electron/reviewers as a code owner Oct 3, 2017

@qazbnm456 qazbnm456 referenced this pull request Oct 3, 2017

Closed

webRequest API is unstable #36

@zcbenz

zcbenz approved these changes Oct 3, 2017

@zcbenz zcbenz merged commit 150a479 into electron:master Oct 3, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@qazbnm456 qazbnm456 deleted the qazbnm456:fix-unhandle-null-pointer branch Oct 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment