Fix a dircache NULL-pointer dereference.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24835 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2010-02-21 22:48:54 +00:00
parent 28bc321dbb
commit 4832c3ce42

View file

@ -252,7 +252,7 @@ static int sab_process_dir(unsigned long startcluster, struct dircache_entry *ce
ce->d_name = "..";
ce->name_len = 3;
ce->attribute = FAT_ATTR_DIRECTORY;
ce->startcluster = first_ce->up->startcluster;
ce->startcluster = (first_ce->up ? first_ce->up->startcluster : 0);
ce->size = 0;
ce->down = first_ce->up;