1
0
Fork 0

DBG+GUI: fixed a crash with escaped section names

This commit is contained in:
mrexodia 2016-07-09 13:03:32 +02:00
parent 9123ed3338
commit 1a7f87d440
No known key found for this signature in database
GPG Key ID: D72F9A4FAA0073B4
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ static bool _sectionfromaddr(duint addr, char* section)
{
if(addr >= cur.addr && addr < cur.addr + (cur.size + (0x1000 - 1) & ~(0x1000 - 1)))
{
strcpy_s(section, MAX_SECTION_SIZE, cur.name);
strncpy_s(section, MAX_SECTION_SIZE * 5, cur.name, _TRUNCATE);
return true;
}
}

View File

@ -212,7 +212,7 @@ void CPUInfoBox::disasmSelectionChanged(dsint parVA)
QString info;
// Section
char section[MAX_SECTION_SIZE];
char section[MAX_SECTION_SIZE * 5];
if(DbgFunctions()->SectionFromAddr(parVA, section))
info += QString(section) + ":";