diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-05-06 05:40:15 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-07 12:52:45 +0530 |
commit | fd2e7d9ebb94ccf5faf5c9d9891978e09fce0b05 (patch) | |
tree | 1cd433831d67ac318a82a08b28f89627bb317862 /xlators/performance | |
parent | 542d9ed6c1758df85fc0e252952cfb80669f4a70 (diff) |
symlink-cache: fix return value of readlink
- sc_readlink wrongly returned strlen (link) + 1 when link was present in
cache.
- this fixes rt #828. Since fuse_readlink_cbk does link[op_ret] = '\0', there
was a memory corruption.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/symlink-cache/src/symlink-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c index ef05defa0af..ad0836c5eb2 100644 --- a/xlators/performance/symlink-cache/src/symlink-cache.c +++ b/xlators/performance/symlink-cache/src/symlink-cache.c @@ -91,7 +91,7 @@ sc_cache_update (xlator_t *this, inode_t *inode, const char *link) int sc_cache_set (xlator_t *this, inode_t *inode, struct stat *buf, - const char *link) + const char *link) { struct symlink_cache *sc = NULL; int ret = -1; @@ -268,7 +268,7 @@ sc_readlink (call_frame_t *frame, xlator_t *this, gf_log (this->name, GF_LOG_DEBUG, "cache hit %s -> %s", loc->path, link); - STACK_UNWIND (frame, strlen (link) + 1, 0, link); + STACK_UNWIND (frame, strlen (link), 0, link); FREE (link); return 0; } |