From 8730e56f628819530afc20cbf09512ad2cb1d83d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 15 Dec 2023 13:50:49 +0100 Subject: [PATCH] LibWeb: Fix uninitialized value in find_a_potential_indicated_element() --- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 4a9c0a3df21..3d1d54fdf66 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1784,7 +1784,7 @@ Element* Document::find_a_potential_indicated_element(FlyString const& fragment) // 2. If there is an a element in the document tree whose root is document that has a name attribute // whose value is equal to fragment, then return the first such element in tree order. - Element* element_with_name; + Element* element_with_name = nullptr; root().for_each_in_subtree_of_type([&](Element const& element) { if (element.attribute(HTML::AttributeNames::name) == fragment) { element_with_name = const_cast(&element);