From 765fdd0809afb1bdac49fae2a0a58ae092e5cde3 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Tue, 5 Feb 2013 17:03:38 -0800 Subject: fuse(efence): zero sized memory was being allocated. For the last call of getdents(), gf_malloc called with 0 size, which is then caught by efence. BUG: 782760 Change-Id: If289029117a62ecfcecc70480e5ac8f0e050487d Signed-off-by: Anand Avati Original-author: Varun Shastry Reviewed-on: http://review.gluster.org/3846 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/mount/fuse/src/fuse-bridge.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/mount/fuse/src') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 25545b7830d..ede936acd82 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -2457,6 +2457,11 @@ fuse_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strlen (entry->d_name)); } + if (size <= 0) { + send_fuse_data (this, finh, 0, 0); + goto out; + } + buf = GF_CALLOC (1, size, gf_fuse_mt_char); if (!buf) { gf_log ("glusterfs-fuse", GF_LOG_DEBUG, -- cgit