summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Aumueller2008-08-03 17:26:30 +0200
committerGravatar Matt Colyer2008-08-04 23:00:21 -0700
commit07fcebbb5e8a741237815507f77ecc4caf264bb9 (patch)
treee350f8bcee3e3c3a22fc3e672c4d3a5c6b2f0ad5
parentab40a42f43dcb273f812706f93d970f95c54bd3f (diff)
downloadlibimobiledevice-07fcebbb5e8a741237815507f77ecc4caf264bb9.tar.gz
libimobiledevice-07fcebbb5e8a741237815507f77ecc4caf264bb9.tar.bz2
Don't crash when afc_get_dirlist returns NULL.
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r--src/ifuse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ifuse.c b/src/ifuse.c
index 5ef354c..4ea91af 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -69,6 +69,10 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
AFClient *afc = fuse_get_context()->private_data;
dirs = afc_get_dir_list(afc, path);
+
+ if(!dirs)
+ return -ENOENT;
+
for (i = 0; strcmp(dirs[i], ""); i++) {
filler(buf, dirs[i], NULL, 0);
}