1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

LibCoredump: Fix use-after-free in Backtrace::object_info_for_region()

The first line was creating a StringView object with region name. Then,
if the path didn't start with '/', it had assigned a String made from a
temporary LexicalPath join result.

This fixes the bug that only main executable's frames were displayed.
This commit is contained in:
Maciej 2022-02-04 19:35:38 +01:00 committed by Andreas Kling
parent d5183cb7ac
commit 394227b2f9

View file

@ -19,7 +19,7 @@ namespace Coredump {
ELFObjectInfo const* Backtrace::object_info_for_region(MemoryRegionInfo const& region)
{
auto path = region.object_name();
String path = region.object_name();
if (!path.starts_with('/') && Core::File::looks_like_shared_library(path))
path = LexicalPath::join("/usr/lib", path).string();