From 0f906ca6849abd31f871d84b8f386ad5a5f8b0bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 29 Mar 2006 22:53:18 +0000 Subject: [PATCH] - GLSA 200603-26 Changed files: bsd-games-tetris.patch -> 1.1 --- bsd-games-tetris.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 bsd-games-tetris.patch diff --git a/bsd-games-tetris.patch b/bsd-games-tetris.patch new file mode 100644 index 0000000..5a6fb1f --- /dev/null +++ b/bsd-games-tetris.patch @@ -0,0 +1,42 @@ +--- bsd-games-2.13/tetris/scores.c.orig 2006-02-10 18:11:41.704770280 +0000 ++++ bsd-games-2.13/tetris/scores.c 2006-02-10 18:25:15.927989536 +0000 +@@ -339,7 +339,8 @@ + continue; + } + } +- levelfound[sp->hs_level] = 1; ++ if (sp->hs_level < NLEVELS && sp->hs_level >= 0) ++ levelfound[sp->hs_level] = 1; + i++, sp++; + } + return (num > MAXHISCORES ? MAXHISCORES : num); +@@ -378,12 +379,14 @@ + for (i = MINLEVEL; i < NLEVELS; i++) + levelfound[i] = 0; + for (i = 0, sp = scores; i < nscores; i++, sp++) { +- if (levelfound[sp->hs_level]) +- sp->hs_time = 0; +- else { +- sp->hs_time = 1; +- levelfound[sp->hs_level] = 1; +- } ++ if (sp->hs_level < NLEVELS && sp->hs_level >= 0) { ++ if (levelfound[sp->hs_level]) ++ sp->hs_time = 0; ++ else { ++ sp->hs_time = 1; ++ levelfound[sp->hs_level] = 1; ++ } ++ } + } + + /* +@@ -437,7 +440,7 @@ + continue; + } + sp = &hs[item]; +- (void)sprintf(buf, ++ (void)snprintf(buf, sizeof(buf), + "%3d%c %6d %-11s (%6d on %d)", + item + offset, sp->hs_time ? '*' : ' ', + sp->hs_score * sp->hs_level, -- 2.43.0