Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-09-22 17:18:30 +0000
committereutarass2011-09-22 17:18:30 +0000
commit95c4a2d2e82cb76def5e008caf51a54814f219f2 (patch)
treeba88b26e50c434fdca4c94025f93e7a8aec9266b
parentb4908277339a1d62b981921604ca170797f057d6 (diff)
downloadorg.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.c2
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) {

Back to the top