aboutsummaryrefslogtreecommitdiffstats
path: root/games/rockdodger
diff options
context:
space:
mode:
authornaddy <naddy@FreeBSD.org>2004-12-02 23:18:44 +0800
committernaddy <naddy@FreeBSD.org>2004-12-02 23:18:44 +0800
commitd66e12185f41d5a80c6f64254da919c1d494ad44 (patch)
tree0e3d00eb9152e52cc5252198a76474020f3c19bd /games/rockdodger
parent89ad41345cc6d4402ff4a441a8fa8d19cd552db7 (diff)
downloadfreebsd-ports-gnome-d66e12185f41d5a80c6f64254da919c1d494ad44.tar.gz
freebsd-ports-gnome-d66e12185f41d5a80c6f64254da919c1d494ad44.tar.zst
freebsd-ports-gnome-d66e12185f41d5a80c6f64254da919c1d494ad44.zip
Fix buffer overflows.
Submitted by: Ulf Harnhammar <Ulf.Harnhammar.9485@student.uu.se>
Diffstat (limited to 'games/rockdodger')
-rw-r--r--games/rockdodger/Makefile2
-rw-r--r--games/rockdodger/files/patch-main.c23
2 files changed, 24 insertions, 1 deletions
diff --git a/games/rockdodger/Makefile b/games/rockdodger/Makefile
index dd514c71f0e8..08fa739be8ec 100644
--- a/games/rockdodger/Makefile
+++ b/games/rockdodger/Makefile
@@ -7,7 +7,7 @@
PORTNAME= rockdodger
PORTVERSION= 0.6
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= spacerocks
diff --git a/games/rockdodger/files/patch-main.c b/games/rockdodger/files/patch-main.c
new file mode 100644
index 000000000000..edeaa6c35930
--- /dev/null
+++ b/games/rockdodger/files/patch-main.c
@@ -0,0 +1,23 @@
+
+$FreeBSD$
+
+--- main.c.orig
++++ main.c
+@@ -459,7 +459,7 @@
+ else {
+ char s[1024];
+ umask(0177);
+- sprintf(s,"%s/.rockdodger_high",getenv("HOME"));
++ snprintf(s,1024,"%s/.rockdodger_high",getenv("HOME"));
+ if (f=fopen(s,mode)) {
+ umask(mask);
+ return f;
+@@ -478,7 +478,7 @@
+ for (i=0; i<8; i++) {
+ char s[1024];
+ int highscore;
+- if (fscanf (f, "%d %[^\n]", &highscore, s)!=2)
++ if (fscanf (f, "%d %1023[^\n]", &highscore, s)!=2)
+ break;
+ if (high[i].allocated)
+ free(high[i].name);