From 4ec7f45e566384096dbbac780bc7144dc0c1704b Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 4 Sep 2018 23:48:49 +0200 Subject: [PATCH] Avoid a crash when hiscore has too many entries --- src/race/highscores.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/race/highscores.cpp b/src/race/highscores.cpp index 1938ca284..a317b521a 100644 --- a/src/race/highscores.cpp +++ b/src/race/highscores.cpp @@ -81,6 +81,12 @@ void Highscores::readEntry(const XMLNode &node) for(unsigned int i=0; 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] );