summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c3
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index ee50329f03b..29bb80ac715 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3637,13 +3637,14 @@ fuse_getxattr_resume (fuse_state_t *state)
(strcmp (state->name, VIRTUAL_GFID_XATTR_KEY) == 0)) {
/* send glusterfs gfid in binary form */
- value = GF_CALLOC (16 + 1, sizeof(char),
+ value = GF_MALLOC (16 + 1,
gf_common_mt_char);
if (!value) {
send_fuse_err (state->this, state->finh, ENOMEM);
goto internal_out;
}
memcpy (value, state->loc.inode->gfid, 16);
+ value[16] = '\0';
send_fuse_xattr (THIS, state->finh, value, 16, state->size);
GF_FREE (value);
diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c
index cb3e081e62e..a4e80b385dd 100644
--- a/xlators/mount/fuse/src/fuse-helpers.c
+++ b/xlators/mount/fuse/src/fuse-helpers.c
@@ -550,7 +550,8 @@ fuse_do_flip_xattr_ns (char *okey, const char *nns, char **nkey)
okey = strchr (okey, '.');
GF_ASSERT (okey);
- key = GF_CALLOC (1, strlen (nns) + strlen(okey) + 1,
+ int key_len = strlen (nns) + strlen(okey);
+ key = GF_MALLOC (key_len + 1,
gf_common_mt_char);
if (!key) {
ret = -1;