Skip to content

Commit

Permalink
guard against invalid urls from bat-native-ads notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Dec 11, 2018
1 parent 4b4f969 commit 9e6b136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deps = {
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@1b4362968c8f22720bfb75af6f506d4ecc0f3116",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@d926cfb84e3f644ab14d0908608025c19c753f4b",
"components/brave_sync/extension/brave-crypto": "https://github.com/brave/crypto@7e391cec6975106fa9f686016f494cb8a782afcd",
"vendor/bat-native-ads": "https://github.com/brave-intl/bat-native-ads.git@041b8b3b8635900b73607cba88d362e3356a3577",
"vendor/bat-native-ads": "https://github.com/brave-intl/bat-native-ads.git@ebad9519a0a6adaff38dce39475bf535da4ec10a",
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@c3b6111aa862c5c452c84be8a225d5f1df32b284",
}

Expand Down
4 changes: 4 additions & 0 deletions components/brave_ads/browser/ads_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,10 @@ void AdsServiceImpl::OpenSettings(Profile* profile,
}

GURL url(notification_info->url);
if (!url.is_valid()) {
LOG(WARNING) << "Invalid notification URL: " << notification_info->url;
return;
}

#if defined(OS_ANDROID)
NavigateParams nav_params(profile, url, ui::PAGE_TRANSITION_LINK);
Expand Down

0 comments on commit 9e6b136

Please sign in to comment.