From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../28-no-garbage-in-code-ids.patch | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 toolkit/crashreporter/breakpad-patches/28-no-garbage-in-code-ids.patch (limited to 'toolkit/crashreporter/breakpad-patches/28-no-garbage-in-code-ids.patch') diff --git a/toolkit/crashreporter/breakpad-patches/28-no-garbage-in-code-ids.patch b/toolkit/crashreporter/breakpad-patches/28-no-garbage-in-code-ids.patch new file mode 100644 index 0000000000..64f791d01e --- /dev/null +++ b/toolkit/crashreporter/breakpad-patches/28-no-garbage-in-code-ids.patch @@ -0,0 +1,34 @@ +diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc +--- a/src/common/linux/file_id.cc ++++ b/src/common/linux/file_id.cc +@@ -115,28 +115,27 @@ static bool FindElfBuildIDNote(const voi + + return false; + } + + // Attempt to locate the .text section of an ELF binary and generate + // a simple hash by XORing the first page worth of bytes into |identifier|. + static bool HashElfTextSection(const void* elf_mapped_base, + wasteful_vector& identifier) { +- identifier.resize(kMDGUIDSize); +- + void* text_section; + size_t text_size; + if (!FindElfSection(elf_mapped_base, ".text", SHT_PROGBITS, + (const void**)&text_section, &text_size) || + text_size == 0) { + return false; + } + + // Only provide |kMDGUIDSize| bytes to keep identifiers produced by this + // function backwards-compatible. ++ identifier.resize(kMDGUIDSize); + my_memset(&identifier[0], 0, kMDGUIDSize); + const uint8_t* ptr = reinterpret_cast(text_section); + const uint8_t* ptr_end = ptr + std::min(text_size, static_cast(4096)); + while (ptr < ptr_end) { + for (unsigned i = 0; i < kMDGUIDSize; i++) + identifier[i] ^= ptr[i]; + ptr += kMDGUIDSize; + } + -- cgit v1.2.3