diff options
author | Anand Avati <avati@redhat.com> | 2013-08-21 17:34:02 -0700 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-09-10 01:20:45 -0700 |
commit | 6f3f1a529663a705a98142b91f6b3a6e4c8fe983 (patch) | |
tree | f3b69b047ff9673e628a383791dea207222d8cc2 /xlators/performance | |
parent | 9cf2c316eabe88d98bfb71f05eea2c5ee3d470c1 (diff) |
io-cache: fix unsafe typcasting of pointer to uint64
The typecast of pointer to uint64_t *, followed by setting of
64bit in inode_ctx_get() results in memory corruption on 32bit
system.
Change-Id: I32fa3bf3b853ed2690a9b9a471099a59b9d7186a
BUG: 997902
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5879
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/io-cache/src/io-cache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 30dc14a9cdb..da27a9e1745 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -316,9 +316,11 @@ ioc_forget (xlator_t *this, inode_t *inode) static int32_t ioc_invalidate(xlator_t *this, inode_t *inode) { + uint64_t ioc_addr = 0; ioc_inode_t *ioc_inode = NULL; - inode_ctx_get(inode, this, (uint64_t *) &ioc_inode); + inode_ctx_get(inode, this, (uint64_t *) &ioc_addr); + ioc_inode = (void *) ioc_addr; if (ioc_inode) ioc_inode_flush(ioc_inode); |