From 36ccadb98b92786dc65af4294851ed538d7166e5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 4 Feb 2012 21:28:14 +0000 Subject: -do not try to mmap empty file --- src/fs/gnunet-fs-gtk_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fs/gnunet-fs-gtk_common.c b/src/fs/gnunet-fs-gtk_common.c index 90077f52..a987b25a 100644 --- a/src/fs/gnunet-fs-gtk_common.c +++ b/src/fs/gnunet-fs-gtk_common.c @@ -210,6 +210,11 @@ GNUNET_FS_GTK_mmap_and_scan (const char *filename, GNUNET_break (0); return GNUNET_SYSERR; } + if (0 == fsize) + { + /* empty file, cannot be a directory */ + return GNUNET_SYSERR; + } if (NULL == (fh = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE))) { -- cgit v1.2.3