From kde-commits Fri Dec 06 13:02:24 2002 From: Lubos Lunak Date: Fri, 06 Dec 2002 13:02:24 +0000 To: kde-commits Subject: kdegames/kreversi [POSSIBLY UNSAFE] X-MARC-Message: https://marc.info/?l=kde-commits&m=103917984303524 CVS commit by lunakl: Max size limit for sscanf(). Also removed useless casts, the second of them hiding a bug. M +2 -2 app.cpp 1.53 [POSSIBLY UNSAFE] --- kdegames/kreversi/app.cpp:1.52 Thu Sep 12 00:47:40 2002 @@ -828,8 +828,8 @@ highscore.resize(i+1); HighScore hs; - sscanf((const char *)e.utf8(), "%s %d %d %d %f %ld", - (char *)&hs.name, &hs.color, &hs.winner, + sscanf( e.utf8(), "%31s %d %d %d %f %ld", + hs.name, &hs.color, &hs.winner, &hs.loser, &hs.rating, &hs.date); highscore[i] = hs; } else