[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegames/kreversi [POSSIBLY UNSAFE]
From:       Lubos Lunak <l.lunak () kde ! org>
Date:       2002-12-06 13:02:24
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic