Skip to content

Commit

Permalink
Prevent access to keyword table if it has not yet been instantiated.
Browse files Browse the repository at this point in the history
This change aims at addressing a null pointer dereferences when the
Chrome is run for the first time on Android.

Change-Id: I59493cc673e51a95673288f60180bc01f46c566d
Fixed: 1405309
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4189311
Reviewed-by: Peter Williamson <petewil@chromium.org>
Reviewed-by: Justin Donnelly <jdonnelly@chromium.org>
Auto-Submit: Tomasz Wiszkowski <ender@google.com>
Commit-Queue: Peter Williamson <petewil@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096515}
  • Loading branch information
tomasz-wiszkowski authored and Chromium LUCI CQ committed Jan 25, 2023
1 parent 540a3c3 commit 4c6ab01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/search_engines/keyword_web_data_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ WebDatabase::State PerformKeywordOperationsImpl(
std::unique_ptr<WDTypedResult> GetKeywordsImpl(WebDatabase* db) {
KeywordTable* const keyword_table = KeywordTable::FromWebDatabase(db);
WDKeywordsResult result;
if (!keyword_table->GetKeywords(&result.keywords))
if (!keyword_table || !keyword_table->GetKeywords(&result.keywords)) {
return nullptr;
}

result.default_search_provider_id =
keyword_table->GetDefaultSearchProviderID();
Expand Down

0 comments on commit 4c6ab01

Please sign in to comment.