Bug 2069454 - Fix conditional uninitialized read r=ltenenbaum
Only global variables are default zero-initialized. In the scenario below, if no messages matches the given `aActionName`, `navigate` is tested for nullity but may be uninitialized, that's UB. Differential Revision: https://phabricator.services.mozilla.com/D323704
This commit is contained in:
committed by
ltenenbaum@mozilla.com
parent
c06541755e
commit
0568d82f67
@@ -22,7 +22,7 @@ nsresult RespondOnClick(nsIPrincipal* aPrincipal, const nsAString& aScope,
|
||||
const IPCNotification& aNotification,
|
||||
const nsAString& aActionName) {
|
||||
if (StaticPrefs::dom_webnotifications_navigate_enabled()) {
|
||||
nsIURI* navigate;
|
||||
nsIURI* navigate = nullptr;
|
||||
if (aActionName.IsEmpty()) {
|
||||
navigate = aNotification.options().navigate();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user