diff options
Diffstat (limited to 'misc/mc/files/patch-vfs-extfs.c')
-rw-r--r-- | misc/mc/files/patch-vfs-extfs.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/misc/mc/files/patch-vfs-extfs.c b/misc/mc/files/patch-vfs-extfs.c new file mode 100644 index 000000000000..105d9d96f2c8 --- /dev/null +++ b/misc/mc/files/patch-vfs-extfs.c @@ -0,0 +1,26 @@ +--- vfs/extfs.c.orig Thu Dec 26 03:42:59 2002 ++++ vfs/extfs.c Tue Jun 15 03:15:09 2004 +@@ -888,8 +888,7 @@ + if (!*info) + return NULL; + +- strncpy(dir.dent.d_name, (*info)->name, MC_MAXPATHLEN); +- dir.dent.d_name[MC_MAXPATHLEN] = 0; ++ g_strlcpy(dir.dent.d_name, (*info)->name, MC_MAXPATHLEN); + + compute_namelen(&dir.dent); + *info = (*info)->next_in_dir; +@@ -1002,10 +1001,10 @@ + if (entry == NULL) + return -1; + if (!S_ISLNK (entry->inode->mode)) ERRNOR (EINVAL, -1); +- if (size > (i = strlen (entry->inode->linkname))) { +- size = i; ++ if (size < (i = strlen (entry->inode->linkname))) { ++ i = size; + } +- strncpy (buf, entry->inode->linkname, i); ++ memcpy (buf, entry->inode->linkname, i); + return i; + } + |