LibCoredump: Copy out the FooInfo structs to an aligned address

We were handing out unaligned pointers to these, which made UBSAN super
mad, copy them out to avoid that.
This commit is contained in:
Ali Mohammad Pur 2022-01-27 14:20:10 +03:30 committed by Linus Groh
commit e72521f286
Notes: sideshowbarker 2024-07-17 20:03:46 +09:00
5 changed files with 56 additions and 22 deletions

View file

@ -153,7 +153,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
Vector<String> memory_regions;
coredump->for_each_memory_region_info([&](auto& memory_region_info) {
memory_regions.append(String::formatted("{:p} - {:p}: {}", memory_region_info.region_start, memory_region_info.region_end, (const char*)memory_region_info.region_name));
memory_regions.append(String::formatted("{:p} - {:p}: {}", memory_region_info.region_start, memory_region_info.region_end, memory_region_info.region_name));
return IterationDecision::Continue;
});