diff --git a/vfs/ChangeLog b/vfs/ChangeLog index c5936c070..20a618960 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,9 @@ 2004-03-07 Andrew V. Samoilov + * direntry.c (vfs_s_resolve_symlink): Check vfs_s_fullpath() + return value to avoid NULL dereference. + Reported by wwp . + * vfs.c (mc_def_ungetlocalcopy): Fix missed "%s". * utilvfs.c (vfs_parse_ls_lga): Likewise. diff --git a/vfs/direntry.c b/vfs/direntry.c index 818a682c3..d661c2988 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -217,9 +217,11 @@ vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry, /* make full path from relative */ if (*linkname != PATH_SEP) { char *fullpath = vfs_s_fullpath (me, entry->dir); - fullname = g_strconcat (fullpath, "/", linkname, NULL); - linkname = fullname; - g_free (fullpath); + if (fullpath) { + fullname = g_strconcat (fullpath, "/", linkname, NULL); + linkname = fullname; + g_free (fullpath); + } } target =