summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/debug/io-stats/src/io-stats.c4
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index 2e05be878bc..2786109b969 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -2129,6 +2129,10 @@ conditional_dump (dict_t *dict, char *key, data_t *value, void *data)
if (fnmatch ("*io*stat*dump", key, 0) == 0) {
+ if (!strncmp (filename, "", 1)) {
+ gf_log (this->name, GF_LOG_ERROR, "No filename given");
+ return;
+ }
logfp = fopen (filename, "w+");
GF_ASSERT (logfp);
if (!logfp) {
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 7e0022d3d58..54d09e6b260 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2413,7 +2413,12 @@ fuse_setxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
return;
}
- dict_value = memdup (value, fsi->size);
+ if (fsi->size > 0) {
+ dict_value = memdup (value, fsi->size);
+ } else {
+ gf_log (THIS->name, GF_LOG_ERROR, "value size zero");
+ dict_value = NULL;
+ }
dict_set (state->dict, newkey,
data_from_dynptr ((void *)dict_value, fsi->size));
dict_ref (state->dict);