Skip to content

Commit

Permalink
Merge pull request #1067 from /issues/2472
Browse files Browse the repository at this point in the history
guard against invalid urls from bat-native-ads notifications
  • Loading branch information
bridiver authored Dec 11, 2018
2 parents 4b4f969 + 9e6b136 commit 4a426e3
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 4a426e3

Please sign in to comment.