From: bitblt Date: Tue, 21 Jan 1997 17:14:42 +0000 (+0000) Subject: Fixed potential buffer overflow. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=58ce840f522ac944459eeb874407e78a70d75002;p=openbsd Fixed potential buffer overflow. --- diff --git a/usr.sbin/amd/amd/mount_fs.c b/usr.sbin/amd/amd/mount_fs.c index dd8661e99a0..3cd9b61f82c 100644 --- a/usr.sbin/amd/amd/mount_fs.c +++ b/usr.sbin/amd/amd/mount_fs.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)mount_fs.c 8.1 (Berkeley) 6/6/93 - * $Id: mount_fs.c,v 1.2 1996/04/03 14:13:05 dm Exp $ + * $Id: mount_fs.c,v 1.3 1997/01/21 17:14:42 bitblt Exp $ */ #include "am.h" @@ -255,7 +255,8 @@ char *opt; char *f; char *o = t; int l = strlen(opt); - strcpy(t, mnt->mnt_opts); + strncpy(t, mnt->mnt_opts, MNTMAXSTR - 1); + t[MNTMAXSTR - 1] = 0; while (*(f = nextmntopt(&o))) if (strncmp(opt, f, l) == 0)