1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:28:13 +00:00

LibWeb: Fix unsafe capture of ref-to-local when setting up load timeout

We were capturing a reference to a stack local and then persisting the
closure, causing it to dereference a long-gone object when invoked.
This commit is contained in:
Andreas Kling 2022-06-23 16:17:08 +02:00
parent a02ee29af9
commit c03a0e7260
2 changed files with 13 additions and 12 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, Dex <dexes.ttp@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
@ -13,7 +13,6 @@
#include <AK/URL.h>
#include <LibCore/Object.h>
#include <LibCore/Proxy.h>
#include <LibCore/Timer.h>
#include <LibWeb/Loader/Resource.h>
namespace Web {
@ -99,7 +98,6 @@ private:
HashTable<NonnullRefPtr<ResourceLoaderConnectorRequest>> m_active_requests;
NonnullRefPtr<ResourceLoaderConnector> m_connector;
String m_user_agent;
RefPtr<Core::Timer> m_timer;
};
}