aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
diff options
context:
space:
mode:
authorerikchen@chromium.org <erikchen@chromium.org>2015-01-27 01:20:59 +0000
committererikchen@chromium.org <erikchen@chromium.org>2015-01-27 01:20:59 +0000
commit7bebb27fb44920f189310985d96ed7801f59afbb (patch)
tree4488552decfc8604e6d4609ba5d56c81baa1e863 /src/common/linux
parentFix a source of memory corruption. (diff)
downloadbreakpad-7bebb27fb44920f189310985d96ed7801f59afbb.tar.xz
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
Diffstat (limited to 'src/common/linux')
-rw-r--r--src/common/linux/elf_symbols_to_module.cc3
1 files changed, 1 insertions, 2 deletions
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;