Avoid a crash when hiscore has too many entries

This commit is contained in:
Deve 2018-09-04 23:48:49 +02:00
parent bcb7e48fb1
commit 4ec7f45e56

View File

@ -81,6 +81,12 @@ void Highscores::readEntry(const XMLNode &node)
for(unsigned int i=0; i<node.getNumNodes(); i++)
{
if (i >= HIGHSCORE_LEN)
{
Log::warn("Highscores", "Hiscore has too many entries.");
break;
}
const XMLNode *entry = node.getNode(i);
entry->get("time", &m_time[i] );
entry->getAndDecode("name", &m_name[i] );