-
Notifications
You must be signed in to change notification settings - Fork 965
Fix crash in BraveStatsUpdater when computer wakes from suspend #552
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
Conversation
Fix crash in BraveStatsUpdater when computer wakes from suspend
Fix crash in BraveStatsUpdater when computer wakes from suspend
if (simple_url_loader_->NetError() != net::OK || response_code < 200 || | ||
response_code > 299) { | ||
LOG(ERROR) << "Failed to send usage stats to update server" | ||
<< ", error: " << simple_url_loader_->NetError() | ||
<< ", response code: " << response_code | ||
<< ", payload: " << *response_body |
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.
@pilgrim-brave I guess this line was the root cause of the crash?
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.
No, the crash was earlier. If SimpleURLLoader received a network error with a large response body, it attempted to copy the entire body into a fixed length buffer to call the OnSimpleLoaderComplete callback function. With a large enough body, this crashed. Fix uses DownloadHeadersOnly to ignore the response body altogether.
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.
OK I see, thanks for catching that!
Fix brave/brave-browser#1116
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: