rocr: fix nullptr dereference (#262)
* rocr: fix nullptr dereference Return early in the case that malloc fails to avoid dereferencing of a null pointer on eventDescrp. Signed-off-by: Sunday Clement <Sunday.Clement@amd.com> * rocr: Fix potential nullptr dereference returns early if sym->section() fails to properly acquire the object. Signed-off-by: Sunday Clement <Sunday.Clement@amd.com> --------- Signed-off-by: Sunday Clement <Sunday.Clement@amd.com> Co-authored-by: Sunday Clement <Sunday.Clement@amd.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
55ca813ded
Коммит
bebe65f104
@@ -1614,6 +1614,8 @@ uint64_t ExecutableImpl::SymbolAddress(hsa_agent_t agent, code::Symbol* sym)
|
||||
uint64_t ExecutableImpl::SymbolAddress(hsa_agent_t agent, elf::Symbol* sym)
|
||||
{
|
||||
elf::Section* sec = sym->section();
|
||||
if(!sec) { return NULL; }
|
||||
|
||||
Segment* seg = SectionSegment(agent, sec);
|
||||
uint64_t vaddr = sec->addr() + sym->value();
|
||||
return nullptr == seg ? 0 : (uint64_t) (uintptr_t) seg->Address(vaddr);
|
||||
|
||||
Ссылка в новой задаче
Block a user