From 2405040f0835367c5f2adac9ea197e439f325920 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 17 Sep 1998 20:18:11 +0000 Subject: Prevent buffer overflow with extra long arguments. --- sbin/restore/interactive.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sbin/restore/interactive.c') 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 @@ -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) -- cgit v1.1