fix VFS crashes.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Jindrich Novy 2010-12-09 10:40:12 +02:00 committed by Andrew Borodin
parent 7cfaeca063
commit a3344024c1
2 changed files with 6 additions and 2 deletions

View File

@ -1166,8 +1166,12 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode)
}
split_dir_name (me, q, &dirname, &name, &save);
/* FIXME: check if vfs_s_find_inode returns NULL */
dir = vfs_s_find_inode (me, super, dirname, LINK_FOLLOW, FL_DIR);
if (dir == NULL)
{
g_free (q);
return NULL;
}
if (save)
*save = PATH_SEP;
ent = vfs_s_generate_entry (me, name, dir, 0755);

View File

@ -222,7 +222,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid)
n3vfsid = NULL;
}
if (!oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid))
if (!oldvfs || !oldvfs->nothingisopen || !(*oldvfs->nothingisopen) (oldvfsid))
return;
vfs_addstamp (oldvfs, oldvfsid);