Commit 01bc4dd0 authored by Parastoo Geranmayeh's avatar Parastoo Geranmayeh Committed by Commit Bot

Avoid potential crash

-- by checking for NULL pointer

Check for the pending_subkey_request_ pointer,
to make sure that it's not NULL.

Bug: 746041
Change-Id: I218245faf54a34eb87b3ebb90d53d710f8b8dc48
Reviewed-on: https://chromium-review.googlesource.com/577764
Commit-Queue: Parastoo Geranmayeh <parastoog@google.com>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488221}
parent 99ff879f
...@@ -125,10 +125,11 @@ void SubKeyRequester::OnAddressValidationRulesLoaded( ...@@ -125,10 +125,11 @@ void SubKeyRequester::OnAddressValidationRulesLoaded(
// The case for |success| == false is already handled. if |success| == false, // The case for |success| == false is already handled. if |success| == false,
// AddressValidator::GetRegionSubKeys will return an empty list of subkeys. // AddressValidator::GetRegionSubKeys will return an empty list of subkeys.
// Therefore, here, we can ignore the value of |success|. // Therefore, here, we can ignore the value of |success|.
// Check if there is any subkey request for that region code. // Check if there is any subkey request for that region code.
if (!pending_subkey_region_code_.compare(region_code)) if (pending_subkey_request_ &&
!pending_subkey_region_code_.compare(region_code)) {
pending_subkey_request_->OnRulesLoaded(); pending_subkey_request_->OnRulesLoaded();
}
pending_subkey_region_code_.clear(); pending_subkey_region_code_.clear();
pending_subkey_request_.reset(); pending_subkey_request_.reset();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment