summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2010-02-21 22:48:54 +0000
committerAmaury Pouly <pamaury@rockbox.org>2010-02-21 22:48:54 +0000
commit4832c3ce420d25e129e6d66dfa35951a9fddc560 (patch)
tree2ac02f4c9a4ee219fc7720917dbdc9785f23c218 /firmware
parent28bc321dbb20bc061c4e39b4eccce4c80fcac4a1 (diff)
downloadrockbox-4832c3ce420d25e129e6d66dfa35951a9fddc560.tar.gz
rockbox-4832c3ce420d25e129e6d66dfa35951a9fddc560.tar.bz2
rockbox-4832c3ce420d25e129e6d66dfa35951a9fddc560.zip
Fix a dircache NULL-pointer dereference.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24835 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/dircache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 618240f542..9f19ac3d24 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -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;