1
0
Fork 0

DBG: resolved issue #194 (very stupid stack overflow in _dbg_addrinfoget)

This commit is contained in:
Mr. eXoDia 2014-12-14 00:46:09 +01:00
parent 6b67cde4d4
commit 388d5a0afe
2 changed files with 4 additions and 7 deletions

View File

@ -87,12 +87,8 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR
bool retval = false;
if(addrinfo->flags & flagmodule) //get module
{
char module[64] = "";
if(modnamefromaddr(addr, module, false) and strlen(module) < MAX_MODULE_SIZE) //get module name
{
strcpy(addrinfo->module, module);
if(modnamefromaddr(addr, addrinfo->module, false)) //get module name
retval = true;
}
}
if(addrinfo->flags & flaglabel)
{

View File

@ -244,9 +244,10 @@ bool modnamefromaddr(uint addr, char* modname, bool extension)
const ModulesInfo::iterator found = modinfo.find(Range(addr, addr));
if(found == modinfo.end()) //not found
return false;
strcpy(modname, found->second.name);
String mod = found->second.name;
if(extension)
strcat(modname, found->second.extension); //append extension
mod += found->second.extension;
strcpy_s(modname, MAX_MODULE_SIZE, mod.c_str());
return true;
}