Skip to content

Commit

Permalink
LaunchServer: Only consider path in OpenURL
Browse files Browse the repository at this point in the history
This resolves the crash in SerenityOS#6812 where the browser was trying to open a
file in the Download directory, but the check against allowed paths was
also trying to match the URL fragment.

Resolves SerenityOS#6812
  • Loading branch information
vkoskiv authored and awesomekling committed May 2, 2021
1 parent b7fb123 commit 5b6f36d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Services/LaunchServer/ClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ Messages::LaunchServer::OpenURLResponse ClientConnection::handle(const Messages:
{
if (!m_allowlist.is_empty()) {
bool allowed = false;
auto request_url_without_fragment = request.url();
request_url_without_fragment.set_fragment({});
for (auto& allowed_handler : m_allowlist) {
if (allowed_handler.handler_name == request.handler_name()
&& (allowed_handler.any_url || allowed_handler.urls.contains_slow(request.url()))) {
&& (allowed_handler.any_url || allowed_handler.urls.contains_slow(request_url_without_fragment))) {
allowed = true;
break;
}
Expand Down

0 comments on commit 5b6f36d

Please sign in to comment.