summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-04-27 21:19:31 +0000
committerkris <kris@FreeBSD.org>2000-04-27 21:19:31 +0000
commit80747e975a688632bb35943cd4abac59def14495 (patch)
tree03d53328055b0b0aa2edccfe2457a0bc4fe0ee3e /games
parenta3e45445b09919cb6e34fdbe87826d1bfbed9d9d (diff)
downloadFreeBSD-ports-80747e975a688632bb35943cd4abac59def14495.zip
FreeBSD-ports-80747e975a688632bb35943cd4abac59def14495.tar.gz
Fix buffer overflow
Reported by: Brock Tellier <btellier@usa.net>
Diffstat (limited to 'games')
-rw-r--r--games/yamsweeper/files/patch-ab11
1 files changed, 11 insertions, 0 deletions
diff --git a/games/yamsweeper/files/patch-ab b/games/yamsweeper/files/patch-ab
new file mode 100644
index 0000000..afce367
--- /dev/null
+++ b/games/yamsweeper/files/patch-ab
@@ -0,0 +1,11 @@
+--- highscore.c.orig Wed Nov 2 16:20:40 1994
++++ highscore.c Thu Apr 27 14:12:23 2000
+@@ -212,7 +212,7 @@
+ read_highscore();
+ if (atoi((char*)high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].seconds) >= done - start) {
+ sprintf(high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].seconds, "%3.3d", done - start);
+- strcpy(high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].uname, getenv(appData.identifier));
++ strncpy(high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].uname, getenv(appData.identifier), sizeof(high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].uname));
+ sprintf(high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].hitime,
+ "%0*ld", sizeof high_score_tab[mode].holders[HIGHSCORE_MAX_KEEP - 1].hitime - 1,
+ (long)time(NULL));
OpenPOWER on IntegriCloud