Debugger: Symbol loading: Fix random crash upon start up. (PR #694)

This commit is contained in:
Kelvin Lee 2019-10-25 06:25:07 +11:00 committed by TomCh
parent bd730e25c0
commit cb007df40b

View File

@ -622,10 +622,13 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
p = strstr(szLine, ";"); // Optional
if(p) *p = 0;
p = strstr(szLine, " "); // 1st space between name & value
int nLen = p - szLine;
if (nLen > MAX_SYMBOLS_LEN)
if (p)
{
memset(&szLine[MAX_SYMBOLS_LEN], ' ', nLen-MAX_SYMBOLS_LEN); // sscanf fails for nAddress if string too long
int nLen = p - szLine;
if (nLen > MAX_SYMBOLS_LEN)
{
memset(&szLine[MAX_SYMBOLS_LEN], ' ', nLen - MAX_SYMBOLS_LEN); // sscanf fails for nAddress if string too long
}
}
sscanf(szLine, sFormat2, sName, &nAddress);
}