summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2011-02-17 19:18:12 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-17 23:32:41 -0800
commite77eae0f04b90ad9722ce82d59fd552cae63c347 (patch)
tree0bb7320761f137b6deba30b9b56b84963cb9ce72 /libglusterfs
parentfc63f24904b14aaad338aa44107cbda7e547e6b1 (diff)
libglusterfs/dict: memcpy() data_t in unserialize.
This fixes a race in dht_getxattr() where the xattr dictionary returned by one of the subvolumes can get free'd before STACK_UNWIND, leading to applications seeing junk values. Signed-off-by: Vikas Gorur <vikas@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2442 (getxattr() on a directory sometimes returns junk) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2442
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/dict.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index ab2487182a1..b351dafd7d1 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -2596,8 +2596,8 @@ dict_unserialize (char *orig_buf, int32_t size, dict_t **fill)
}
value = get_new_data ();
value->len = vallen;
- value->data = buf;
- value->is_static = 1;
+ value->data = memdup (buf, vallen);
+ value->is_static = 0;
buf += vallen;
dict_set (*fill, key, value);