From 082cfbbed6f925f88244d0cd65de0dede9f7f012 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 7 Jun 1998 06:04:26 +0000 Subject: buf oflow --- usr.sbin/bootpd/bootpd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bootpd/bootpd.c b/usr.sbin/bootpd/bootpd.c index 0fa103135ca..7192f5c846b 100644 --- a/usr.sbin/bootpd/bootpd.c +++ b/usr.sbin/bootpd/bootpd.c @@ -21,7 +21,7 @@ SOFTWARE. ************************************************************************/ #ifndef lint -static char rcsid[] = "$Id: bootpd.c,v 1.3 1996/07/11 10:54:50 mickey Exp $"; +static char rcsid[] = "$Id: bootpd.c,v 1.4 1998/06/07 06:04:25 deraadt Exp $"; #endif /* @@ -812,7 +812,8 @@ HW addr type is IEEE 802. convert to %s and check again\n", * daemon chroot directory (i.e. /tftpboot). */ if (hp->flags.tftpdir) { - strcpy(realpath, hp->tftpdir->string); + strncpy(realpath, hp->tftpdir->string, sizeof realpath-1); + realpath[sizeof realpath-1] = '\0'; clntpath = &realpath[strlen(realpath)]; } else { realpath[0] = '\0'; -- cgit v1.2.3