diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:40:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:40:47 +0000 |
commit | 46db793222dee55d0b846c6ba99a39e2d969c52a (patch) | |
tree | d95f8ea0fb9c9c4eb9ae55c70faa2bc02a7bcea4 /toolkit/crashreporter | |
parent | Adding upstream version 115.9.1esr. (diff) | |
download | firefox-esr-upstream/115.10.0esr.tar.xz firefox-esr-upstream/115.10.0esr.zip |
Adding upstream version 115.10.0esr.upstream/115.10.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter')
-rw-r--r-- | toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc | 15 | ||||
-rw-r--r-- | toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h | 3 |
2 files changed, 11 insertions, 7 deletions
diff --git a/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc b/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc index e13e4509b0..64c01bdce4 100644 --- a/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc +++ b/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.cc @@ -83,7 +83,7 @@ MinidumpGenerator::MinidumpGenerator() cpu_type_(DynamicImages::GetNativeCPUType()), dyldImageLoadAddress_(NULL), dyldSlide_(0), - dyldPath_(), + dyldPath_(nullptr), task_context_(NULL), dynamic_images_(NULL), memory_blocks_(&allocator_) { @@ -105,7 +105,7 @@ MinidumpGenerator::MinidumpGenerator(mach_port_t crashing_task, cpu_type_(DynamicImages::GetNativeCPUType()), dyldImageLoadAddress_(NULL), dyldSlide_(0), - dyldPath_(), + dyldPath_(nullptr), task_context_(NULL), dynamic_images_(NULL), memory_blocks_(&allocator_) { @@ -250,7 +250,7 @@ void MinidumpGenerator::GatherCurrentProcessDyldInformation() { return; } dyldImageLoadAddress_ = mh; - dyldPath_ = string(aii->dyldPath); + dyldPath_ = aii->dyldPath; dyldSlide_ = GetCurrentProcessModuleSlide(mh, aii->sharedCacheSlide); } @@ -1464,7 +1464,7 @@ bool MinidumpGenerator::WriteModuleStream(unsigned int index, if (index == INT_MAX) { dyld_or_in_dyld_shared_cache = true; slide = dyldSlide_; - name = dyldPath_.c_str(); + name = dyldPath_; } else { dyld_or_in_dyld_shared_cache = ((header->flags & MH_SHAREDCACHE) != 0); @@ -1993,7 +1993,7 @@ bool MinidumpGenerator::WriteCrashInfoStream( bool dyld_or_in_dyld_shared_cache; if (i == image_count - 1) { slide = dyldSlide_; - module_path = dyldPath_.c_str(); + module_path = dyldPath_; dyld_or_in_dyld_shared_cache = true; } else { slide = _dyld_get_image_vmaddr_slide(i); @@ -2048,7 +2048,10 @@ bool MinidumpGenerator::WriteBootargsStream( int rv = sysctlbyname("kern.bootargs", NULL, &size, NULL, 0); if ((rv != 0) || (size == 0)) size = 1; - vector<uint8_t> bootargs(size); + + wasteful_vector<uint8_t> bootargs(&this->allocator_, size); + bootargs.resize(size, 0); + bootargs[0] = 0; if (rv == 0) sysctlbyname("kern.bootargs", &bootargs[0], &size, NULL, 0); diff --git a/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h b/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h index aba067cc04..77c250ccd5 100644 --- a/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h +++ b/toolkit/crashreporter/breakpad-client/mac/handler/minidump_generator.h @@ -266,7 +266,8 @@ class MinidumpGenerator { // process has crashed. breakpad_mach_header* dyldImageLoadAddress_; ptrdiff_t dyldSlide_; - string dyldPath_; + // We don't own this pointer, this is owned by macOS internal structures. + const char* dyldPath_; // Context of the task to dump. breakpad_ucontext_t *task_context_; |