diff options
author | eutarass | 2011-09-22 17:18:30 +0000 |
---|---|---|
committer | eutarass | 2011-09-22 17:18:30 +0000 |
commit | 95c4a2d2e82cb76def5e008caf51a54814f219f2 (patch) | |
tree | ba88b26e50c434fdca4c94025f93e7a8aec9266b | |
parent | b4908277339a1d62b981921604ca170797f057d6 (diff) | |
download | org.eclipse.tcf.agent-95c4a2d2e82cb76def5e008caf51a54814f219f2.tar.gz org.eclipse.tcf.agent-95c4a2d2e82cb76def5e008caf51a54814f219f2.tar.xz org.eclipse.tcf.agent-95c4a2d2e82cb76def5e008caf51a54814f219f2.zip |
TCF Agent: fixed: find_symbol_by_name() in Symbols service can crash if called with *res != NULL.
-rw-r--r-- | services/symbols_elf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/symbols_elf.c b/services/symbols_elf.c index 83f79a76..cc4160f5 100644 --- a/services/symbols_elf.c +++ b/services/symbols_elf.c @@ -656,6 +656,7 @@ int find_symbol_by_name(Context * ctx, int frame, ContextAddress ip, char * name CompUnit * unit = range->mUnit; ContextAddress rt_addr = elf_map_to_run_time_address(sym_ctx, file, unit->mTextSection, range->mAddr); if (rt_addr != 0) { + *res = NULL; sym_ip = rt_addr; if (find_in_object_tree(unit->mObject->mChildren, rt_addr - range->mAddr, sym_ip, name, res)) found = 1; if (!found && unit->mBaseTypes != NULL) { @@ -692,6 +693,7 @@ int find_symbol_in_scope(Context * ctx, int frame, ContextAddress ip, Symbol * s int error = 0; int found = 0; + *res = NULL; if (get_sym_context(ctx, frame, ip) < 0) error = errno; if (!error && scope == NULL && sym_ip != 0) { |