From 4e51acde477be018611db6e1e01b4eb41b05ec34 Mon Sep 17 00:00:00 2001 From: rtldg Date: Wed, 31 Dec 2025 15:13:26 +0000 Subject: [PATCH] Switch back to std::string in patch to fix a use-after-free --- ...Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch b/patches/0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch index e3fd2c0..3218713 100644 --- a/patches/0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch +++ b/patches/0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch @@ -18,12 +18,12 @@ index 70d50f89..f21460bf 100644 iterator->shndx != SHN_UNDEF) { - auto ext = std::make_unique(iterator->value); - ext->name = SymbolString(iterator->name_offset, strings); -+ auto name = SymbolString(iterator->name_offset, strings); ++ std::string name = SymbolString(iterator->name_offset, strings); #if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle. int status = 0; char* demangled = - abi::__cxa_demangle(ext->name.c_str(), nullptr, nullptr, &status); -+ abi::__cxa_demangle(name, nullptr, nullptr, &status); ++ abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status); if (demangled) { if (status == 0) - ext->name = demangled;