From 7f923cc9c0d1279a9d42aa9aedc058adbcea7d35 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 15 Aug 2002 21:31:54 +0000 Subject: [PATCH] * direntry.c (vfs_s_getlocalcopy): Fix potentially dangerous strcpy(). --- vfs/ChangeLog | 3 +++ vfs/direntry.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index d94dc4a13..004527d06 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,8 @@ 2002-08-15 Pavel Roskin + * direntry.c (vfs_s_getlocalcopy): Fix potentially dangerous + strcpy(). + * extfs.c (s_readdir): Simplify. * direntry.c (vfs_s_readdir): Use vfs_dirent. * mcfs.c (mcfs_readdir): Likewise. diff --git a/vfs/direntry.c b/vfs/direntry.c index 6cbad3056..158b01f7a 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -1027,7 +1027,7 @@ vfs_s_getlocalcopy (vfs *me, char *path) struct vfs_s_inode *ino; char buf[MC_MAXPATHLEN]; - strcpy (buf, path); + strncpy (buf, path, MC_MAXPATHLEN); ino = vfs_s_inode_from_path (me, path, FL_FOLLOW | FL_NONE); if (!ino->localname)