summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c3
-rw-r--r--xlators/features/snapview-server/src/snapview-server-mgmt.c2
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c5
3 files changed, 5 insertions, 5 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index 0b706919924..8351922af24 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -1773,7 +1773,8 @@ svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (ret)
gf_log (this->name, GF_LOG_ERROR, "failed to set inode "
"context");
- svc_fd->last_offset = entry->d_off;
+ if (svc_fd)
+ svc_fd->last_offset = entry->d_off;
}
unwind = svc_readdir_on_special_dir (frame, cookie, this, op_ret,
diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c
index a4ce89cd47c..0fe3687e204 100644
--- a/xlators/features/snapview-server/src/snapview-server-mgmt.c
+++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c
@@ -468,7 +468,7 @@ out:
}
GF_FREE (req.dict.dict_val);
- if (frame_cleanup) {
+ if (frame_cleanup && frame) {
/*
* Destroy the frame if we encountered an error
* Else we need to clean it up in
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index 4820181cb56..035dd54d1f9 100644
--- a/xlators/features/snapview-server/src/snapview-server.c
+++ b/xlators/features/snapview-server/src/snapview-server.c
@@ -478,7 +478,6 @@ svs_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
int32_t ret = -1;
svs_private_t *private = NULL;
inode_t *parent = NULL;
- glfs_t *fs = NULL;
snap_dirent_t *dirent = NULL;
gf_boolean_t entry_point_key = _gf_false;
gf_boolean_t entry_point = _gf_false;
@@ -525,7 +524,7 @@ svs_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
dirent = svs_get_latest_snap_entry (this);
if (dirent && !dirent->fs) {
- fs = svs_initialise_snapshot_volume (this, dirent->name, NULL);
+ svs_initialise_snapshot_volume (this, dirent->name, NULL);
}
if (xdata && !inode_ctx) {
@@ -734,7 +733,7 @@ svs_add_xattrs_to_dict (xlator_t *this, dict_t *dict, char *list, ssize_t size)
remaining_size = size;
list_offset = 0;
while (remaining_size > 0) {
- strcpy (keybuffer, list + list_offset);
+ strncpy (keybuffer, list + list_offset, sizeof (keybuffer) - 1);
#ifdef GF_DARWIN_HOST_OS
/* The protocol expect namespace for now */
char *newkey = NULL;