From 1a03a27c8651e33f2dd2274e0c7eeaa998a80b8c Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Fri, 15 Nov 2024 23:58:02 +0100 Subject: [PATCH] AK: Disallow creating `NonnullRawPtr`s from r-value references This would always result in a use-after-free. --- AK/NonnullRawPtr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/NonnullRawPtr.h b/AK/NonnullRawPtr.h index a271160e0d8..cb596f7af5d 100644 --- a/AK/NonnullRawPtr.h +++ b/AK/NonnullRawPtr.h @@ -21,6 +21,7 @@ public: using ValueType = T; NonnullRawPtr() = delete; + NonnullRawPtr(T const&&) = delete; NonnullRawPtr(T& other) : m_ptr(&other)