From 833ba57ccea1bc63a32e349d880b5832b98e19e2 Mon Sep 17 00:00:00 2001 From: hwfqb Date: Fri, 1 Aug 2025 16:24:21 +0800 Subject: [PATCH] add return for EmitByUvWithoutCheckShared to avoid uaf problem Signed-off-by: hwfqb --- utils/napi_utils/src/event_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/napi_utils/src/event_manager.cpp b/utils/napi_utils/src/event_manager.cpp index 75f3e108d..e3d77df4a 100644 --- a/utils/napi_utils/src/event_manager.cpp +++ b/utils/napi_utils/src/event_manager.cpp @@ -128,16 +128,19 @@ void EventManager::EmitByUvWithoutCheckShared(const std::string &type, void *dat if (type == ON_HEADER_RECEIVE || type == ON_HEADERS_RECEIVE) { auto tempMap = static_cast *>(data); delete tempMap; + return; } } else if (foundHeader && !foundHeaders) { if (type == ON_HEADERS_RECEIVE) { auto tempMap = static_cast *>(data); delete tempMap; + return; } } else if (!foundHeader) { if (type == ON_HEADER_RECEIVE) { auto tempMap = static_cast *>(data); delete tempMap; + return; } } -- Gitee