1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

Fix buffer overflow

Submitted by:	Niels Heinen <niels.heinen@ubizen.com>
Approved by:	kris
This commit is contained in:
Patrick Li 2002-09-23 00:33:53 +00:00
parent 8db8391dc9
commit 71350407be
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=67046
2 changed files with 21 additions and 0 deletions

View File

@ -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}

View File

@ -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