From 7bebb27fb44920f189310985d96ed7801f59afbb Mon Sep 17 00:00:00 2001 From: "erikchen@chromium.org" Date: Tue, 27 Jan 2015 01:20:59 +0000 Subject: Fix some fragile code that is likely to cause future memory corruption problems. - The ordering of keys in stl containers cannot change. Make the relevant members const to guarantee this assumption. - Add handling and logging for demangle errors. - Fix a potential double-delete bug if a function passed to AddFunction() is already present. BUG=chromium:449214 R=mark@chromium.org Review URL: https://breakpad.appspot.com/10704002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1415 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/linux/elf_symbols_to_module.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/common/linux') diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc index 82d53dd1..96c64fb6 100644 --- a/src/common/linux/elf_symbols_to_module.cc +++ b/src/common/linux/elf_symbols_to_module.cc @@ -155,9 +155,8 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section, while(!iterator->at_end) { if (ELF32_ST_TYPE(iterator->info) == STT_FUNC && iterator->shndx != SHN_UNDEF) { - Module::Extern *ext = new Module::Extern; + Module::Extern *ext = new Module::Extern(iterator->value); ext->name = SymbolString(iterator->name_offset, strings); - ext->address = iterator->value; module->AddExtern(ext); } ++iterator; -- cgit v1.2.1