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

Fixes crash for null ptr #4263

Merged
merged 1 commit into from
Dec 19, 2019
Merged

Fixes crash for null ptr #4263

merged 1 commit into from
Dec 19, 2019

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Dec 19, 2019

Resolves brave/brave-browser#7363

It was introduced in here #4120

Submitter Checklist:

Test Plan:

don't have STR, but this was found from the crash reports and what @emerick found as well

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@NejcZdovc NejcZdovc added this to the 1.4.x - Nightly milestone Dec 19, 2019
@NejcZdovc NejcZdovc requested a review from a team December 19, 2019 11:00
@NejcZdovc NejcZdovc self-assigned this Dec 19, 2019
Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

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

LGTM++

base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE,
base::BindOnce(&SavePublisherInfoOnFileTaskRunner,
publisher_info->Clone(),
std::move(copy),
Copy link
Collaborator

@tmancey tmancey Dec 19, 2019

Choose a reason for hiding this comment

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

If a developer is copy/pasting there is potential for a bug, a safer approach would be to clone publisher_info inline for each std::bind. However, as we all know, copy/paste is the root of all evil

base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE,
base::BindOnce(&SavePublisherInfoOnFileTaskRunner,
publisher_info->Clone(),
std::move(copy),
Copy link
Contributor Author

@NejcZdovc NejcZdovc Dec 19, 2019

Choose a reason for hiding this comment

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

this was the main problem, why we saw crashes. If checks are just additional safety measurements

@NejcZdovc NejcZdovc added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 labels Dec 19, 2019
@NejcZdovc
Copy link
Contributor Author

everything passed except Windows (build stopped), so restarting

@NejcZdovc NejcZdovc merged commit a55f63f into master Dec 19, 2019
@NejcZdovc NejcZdovc deleted the crash-fix branch December 19, 2019 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 feature/rewards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brave always crashes when trying to enter a website
2 participants