cid#1606642 Data race condition
[LibreOffice.git] / external / breakpad / sanitizer.patch
blob5d673103d95b7c69911701319cc5de9a979e1fbe
1 --- src/client/linux/minidump_writer/minidump_writer.cc
2 +++ src/client/linux/minidump_writer/minidump_writer.cc
3 @@ -717,7 +717,7 @@
4 const std::vector<uint64_t> crash_exception_info =
5 dumper_->crash_exception_info();
6 stream->exception_record.number_parameters = crash_exception_info.size();
7 - memcpy(stream->exception_record.exception_information,
8 + if (!crash_exception_info.empty()) memcpy(stream->exception_record.exception_information,
9 crash_exception_info.data(),
10 sizeof(uint64_t) * crash_exception_info.size());
11 stream->thread_context = crashing_thread_context_;
12 @@ -760,7 +760,7 @@
13 // Adjust base address with the virtual address of the PT_LOAD segment
14 // corresponding to offset 0
15 if (ph.p_type == PT_LOAD && ph.p_offset == 0) {
16 - base -= ph.p_vaddr;
17 + base = reinterpret_cast<char*>(reinterpret_cast<uintptr_t>(base) - ph.p_vaddr);
19 if (ph.p_type == PT_DYNAMIC) {
20 dyn_addr = ph.p_vaddr;
21 @@ -769,7 +769,7 @@
22 if (!dyn_addr)
23 return false;
25 - ElfW(Dyn)* dynamic = reinterpret_cast<ElfW(Dyn)*>(dyn_addr + base);
26 + ElfW(Dyn)* dynamic = reinterpret_cast<ElfW(Dyn)*>(dyn_addr + reinterpret_cast<uintptr_t>(base));
28 // The dynamic linker makes information available that helps gdb find all
29 // DSOs loaded into the program. If this information is indeed available,