aboutsummaryrefslogtreecommitdiffstats
path: root/games/qstat
diff options
context:
space:
mode:
authorpat <pat@FreeBSD.org>2002-09-23 08:33:53 +0800
committerpat <pat@FreeBSD.org>2002-09-23 08:33:53 +0800
commite8c0657579991dc3992ab86b80074da55578b050 (patch)
tree38fdecc7d0502a955163cf76e1c7af83ba481121 /games/qstat
parent1dc30cdd8307bba9cfb0483dfba99326f1f36caf (diff)
downloadfreebsd-ports-gnome-e8c0657579991dc3992ab86b80074da55578b050.tar.gz
freebsd-ports-gnome-e8c0657579991dc3992ab86b80074da55578b050.tar.zst
freebsd-ports-gnome-e8c0657579991dc3992ab86b80074da55578b050.zip
Fix buffer overflow
Submitted by: Niels Heinen <niels.heinen@ubizen.com> Approved by: kris
Diffstat (limited to 'games/qstat')
-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