]> git.pld-linux.org Git - packages/bsd-games.git/blame - bsd-games-tetris.patch
- CVE reference for debian patch
[packages/bsd-games.git] / bsd-games-tetris.patch
CommitLineData
0f906ca6
ER
1--- bsd-games-2.13/tetris/scores.c.orig 2006-02-10 18:11:41.704770280 +0000
2+++ bsd-games-2.13/tetris/scores.c 2006-02-10 18:25:15.927989536 +0000
3@@ -339,7 +339,8 @@
4 continue;
5 }
6 }
7- levelfound[sp->hs_level] = 1;
8+ if (sp->hs_level < NLEVELS && sp->hs_level >= 0)
9+ levelfound[sp->hs_level] = 1;
10 i++, sp++;
11 }
12 return (num > MAXHISCORES ? MAXHISCORES : num);
13@@ -378,12 +379,14 @@
14 for (i = MINLEVEL; i < NLEVELS; i++)
15 levelfound[i] = 0;
16 for (i = 0, sp = scores; i < nscores; i++, sp++) {
17- if (levelfound[sp->hs_level])
18- sp->hs_time = 0;
19- else {
20- sp->hs_time = 1;
21- levelfound[sp->hs_level] = 1;
22- }
23+ if (sp->hs_level < NLEVELS && sp->hs_level >= 0) {
24+ if (levelfound[sp->hs_level])
25+ sp->hs_time = 0;
26+ else {
27+ sp->hs_time = 1;
28+ levelfound[sp->hs_level] = 1;
29+ }
30+ }
31 }
32
33 /*
34@@ -437,7 +440,7 @@
35 continue;
36 }
37 sp = &hs[item];
38- (void)sprintf(buf,
39+ (void)snprintf(buf, sizeof(buf),
40 "%3d%c %6d %-11s (%6d on %d)",
41 item + offset, sp->hs_time ? '*' : ' ',
42 sp->hs_score * sp->hs_level,
This page took 0.101666 seconds and 4 git commands to generate.