diff options
author | imp <imp@FreeBSD.org> | 1998-09-17 20:18:11 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1998-09-17 20:18:11 +0000 |
commit | 2405040f0835367c5f2adac9ea197e439f325920 (patch) | |
tree | 9b4788ed3103a52c52532359b75c8e4e3c1ac82c | |
parent | 910640d3d74d8c173a698371a395943ed3da7f62 (diff) | |
download | FreeBSD-src-2405040f0835367c5f2adac9ea197e439f325920.zip FreeBSD-src-2405040f0835367c5f2adac9ea197e439f325920.tar.gz |
Prevent buffer overflow with extra long arguments.
-rw-r--r-- | sbin/restore/interactive.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index 09548c5..763ca13 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95"; #endif static const char rcsid[] = - "$Id$"; + "$Id: interactive.c,v 1.5 1998/07/28 06:20:08 charnier Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -366,9 +366,7 @@ getnext: * For relative pathnames, prepend the current directory to * it then canonicalize and return it. */ - (void) strcpy(output, curdir); - (void) strcat(output, "/"); - (void) strcat(output, rawname); + snprintf(output, sizeof(output), "%s/%s", curdir, rawname); canon(output, name, size); } if (glob(name, GLOB_ALTDIRFUNC, NULL, &ap->glob) < 0) |