OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../bsd-games/CVE-2006-1539.patch
  5. # Copyright (C) 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -Nur bsd-games-2.17-orig/tetris/scores.c bsd-games-2.17/tetris/scores.c
  17. --- bsd-games-2.17-orig/tetris/scores.c 2004-01-27 20:52:07.000000000 +0000
  18. +++ bsd-games-2.17/tetris/scores.c 2006-06-02 11:14:21.000000000 +0000
  19. @@ -335,7 +335,8 @@
  20. continue;
  21. }
  22. }
  23. - levelfound[sp->hs_level] = 1;
  24. + if (sp->hs_level < NLEVELS && sp->hs_level >= 0)
  25. + levelfound[sp->hs_level] = 1;
  26. i++, sp++;
  27. }
  28. return (num > MAXHISCORES ? MAXHISCORES : num);
  29. @@ -374,12 +375,14 @@
  30. for (i = MINLEVEL; i < NLEVELS; i++)
  31. levelfound[i] = 0;
  32. for (i = 0, sp = scores; i < nscores; i++, sp++) {
  33. - if (levelfound[sp->hs_level])
  34. - sp->hs_time = 0;
  35. - else {
  36. - sp->hs_time = 1;
  37. - levelfound[sp->hs_level] = 1;
  38. - }
  39. + if (sp->hs_level < NLEVELS && sp->hs_level >= 0) {
  40. + if (levelfound[sp->hs_level])
  41. + sp->hs_time = 0;
  42. + else {
  43. + sp->hs_time = 1;
  44. + levelfound[sp->hs_level] = 1;
  45. + }
  46. + }
  47. }
  48. /*
  49. @@ -433,7 +436,7 @@
  50. continue;
  51. }
  52. sp = &hs[item];
  53. - (void)sprintf(buf,
  54. + (void)snprintf(buf, sizeof(buf),
  55. "%3d%c %6d %-11s (%6d on %d)",
  56. item + offset, sp->hs_time ? '*' : ' ',
  57. sp->hs_score * sp->hs_level,