* direntry.c (vfs_s_resolve_symlink): Check vfs_s_fullpath()

return value to avoid NULL dereference.
Reported by wwp <subscript@free.fr>.
This commit is contained in:
Andrew V. Samoilov 2004-03-07 06:12:49 +00:00
parent 2f7bbc2c31
commit 02db8a9660
2 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2004-03-07 Andrew V. Samoilov <sav@bcs.zp.ua>
* direntry.c (vfs_s_resolve_symlink): Check vfs_s_fullpath()
return value to avoid NULL dereference.
Reported by wwp <subscript@free.fr>.
* vfs.c (mc_def_ungetlocalcopy): Fix missed "%s".
* utilvfs.c (vfs_parse_ls_lga): Likewise.

View File

@ -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 =