Commit 9ce0aebc authored by Jialiu Lin's avatar Jialiu Lin Committed by Commit Bot

Check if verdict entry is a dictionary before call FindKey

A CHECK in base::Value::FindKey(..) is hit in a small number of crashes
during shutdown. A check should be in place to make sure the base::Value
instance is in fact a dictionary before calling FindKey(..)

Bug: 890399
Change-Id: I0b24395afc192dbab03f241d94b25309923758d6
Reviewed-on: https://chromium-review.googlesource.com/1252623Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: Jialiu Lin <jialiul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595204}
parent abc90186
...@@ -676,7 +676,7 @@ bool PasswordProtectionService::ParseVerdictEntry( ...@@ -676,7 +676,7 @@ bool PasswordProtectionService::ParseVerdictEntry(
int* out_verdict_received_time, int* out_verdict_received_time,
LoginReputationClientResponse* out_verdict) { LoginReputationClientResponse* out_verdict) {
std::string serialized_verdict_proto; std::string serialized_verdict_proto;
if (!verdict_entry || !out_verdict) if (!verdict_entry || !verdict_entry->is_dict() || !out_verdict)
return false; return false;
base::Value* cache_creation_time_value = base::Value* cache_creation_time_value =
verdict_entry->FindKey(kCacheCreationTime); verdict_entry->FindKey(kCacheCreationTime);
......
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