summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorPatrick Li <pat@FreeBSD.org>2002-09-23 00:33:53 +0000
committerPatrick Li <pat@FreeBSD.org>2002-09-23 00:33:53 +0000
commit71350407bed9ca4d326898076371ccb65223b194 (patch)
treef164e12e861ff99cdfd4e366a2f990f2310bdb2a /games
parentMake this fetchable. (diff)
Fix buffer overflow
Submitted by: Niels Heinen <niels.heinen@ubizen.com> Approved by: kris
Notes
Notes: svn path=/head/; revision=67046
Diffstat (limited to 'games')
-rw-r--r--games/qstat/Makefile1
-rw-r--r--games/qstat/files/patch-config.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/games/qstat/Makefile b/games/qstat/Makefile
index 7cdfce02c2d3..892492daef8e 100644
--- a/games/qstat/Makefile
+++ b/games/qstat/Makefile
@@ -7,6 +7,7 @@
PORTNAME= qstat
PORTVERSION= 2.5.b
+PORTREVISION= 1
CATEGORIES= games net
MASTER_SITES= http://www.qstat.org/
DISTNAME= qstat${PORTVERSION:S/.//g}
diff --git a/games/qstat/files/patch-config.c b/games/qstat/files/patch-config.c
new file mode 100644
index 000000000000..c8ce4dbf6241
--- /dev/null
+++ b/games/qstat/files/patch-config.c
@@ -0,0 +1,20 @@
+--- config.c.orig Tue Aug 6 21:13:34 2002
++++ config.c Sun Sep 22 09:00:30 2002
+@@ -157,7 +157,7 @@
+
+ var= getenv( "HOME");
+ if ( var != NULL && var[0] != '\0') {
+- sprintf( path, "%s/%s", var, HOME_CONFIG_FILE);
++ snprintf( path, (sizeof(path) -1),"%s/%s", var, HOME_CONFIG_FILE);
+ rc= try_load_config_file( path, 0);
+ if ( rc == 0 || rc == -1)
+ return rc;
+@@ -197,7 +197,7 @@
+ filename= getenv( "HOME");
+ if ( filename != NULL && filename[0] != '\0') {
+ char path[1024];
+- sprintf( path, "%s/%s", filename, HOME_CONFIG_FILE);
++ snprintf( path, (sizeof(path) -1),"%s/%s", var, HOME_CONFIG_FILE);
+ }
+ /* 1. $QSTAT_CONFIG
+ 2. UNIX: $HOME/.qstatrc WIN: $HOME/qstat.cfg