From 58ce840f522ac944459eeb874407e78a70d75002 Mon Sep 17 00:00:00 2001 From: bitblt Date: Tue, 21 Jan 1997 17:14:42 +0000 Subject: [PATCH] Fixed potential buffer overflow. --- usr.sbin/amd/amd/mount_fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.20.1