From 2def86bcd7e04ff1d75e0572180638b7e6288879 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Mon, 17 Jul 2023 10:45:20 +0200 Subject: [PATCH] uaf.cpp: add pref_change_registrar_ test --- t3sts/semgrep_rules/uaf.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t3sts/semgrep_rules/uaf.cpp b/t3sts/semgrep_rules/uaf.cpp index d322bbd9..47dfd2d2 100644 --- a/t3sts/semgrep_rules/uaf.cpp +++ b/t3sts/semgrep_rules/uaf.cpp @@ -45,4 +45,9 @@ v8::Local uaf(v8::Isolate* isolate) { base::BindRepeating(&BraveLeoAssistantHandler::HandleInitLeoAssistant, base::Unretained(this))); + // ok: chromium-unretained-uaf + pref_change_registrar_.Add( + prefs::kEnabled, + base::BindRepeating(&AdsServiceImpl::OnEnabledPrefChanged, + base::Unretained(this))); }