瀏覽代碼

RequestServer: Make value copy of the URL in ensure_connection()

I saw what looked like a UAF of this URL in a RequestServer crash,
and it seems reasonable to make a copy here since we end up passing
them to Core::deferred_invoke().
Andreas Kling 3 年之前
父節點
當前提交
8b8a1449c4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Services/RequestServer/ClientConnection.cpp

+ 1 - 1
Userland/Services/RequestServer/ClientConnection.cpp

@@ -126,7 +126,7 @@ void ClientConnection::ensure_connection(URL const& url, ::RequestServer::CacheL
     }
     }
 
 
     struct {
     struct {
-        URL const& m_url;
+        URL m_url;
         void start(Core::Stream::Socket& socket)
         void start(Core::Stream::Socket& socket)
         {
         {
             auto is_connected = socket.is_open();
             auto is_connected = socket.is_open();