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 <avati@redhat.com>
Original-author: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3846
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
Anand Avati 2013-02-05 17:03:38 -08:00
parent e8d09b9ab9
commit 765fdd0809

View File

@ -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,