Skip to content

Commit

Permalink
LibWeb: Fix use-after-move in URLSearchParams::update
Browse files Browse the repository at this point in the history
This was previously still valid since the `Optional<String>` move
constructor copied its input, but since the move is now destructive,
the code no longer works.
  • Loading branch information
yyny authored and Hendiadyoin1 committed Nov 9, 2024
1 parent 89e8f46 commit 46c243d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void URLSearchParams::update()
serialized_query = {};

// 4. Set query’s URL object’s URL’s query to serializedQuery.
m_url->set_query({}, move(serialized_query));
m_url->set_query({}, serialized_query);

// 5. If serializedQuery is null, then potentially strip trailing spaces from an opaque path with query’s URL object.
if (!serialized_query.has_value())
Expand Down

0 comments on commit 46c243d

Please sign in to comment.