diff options
author | Gaurav <gaurav@gluster.com> | 2011-06-01 00:05:31 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-01 00:29:52 -0700 |
commit | 52ad8a814d9137e9e83b70638fa13e77c09d22c0 (patch) | |
tree | 051fa7cb70bf2cd77b752403231c83f61c55c16b /xlators/nfs | |
parent | bfafbfe4ed1a9b910e0fdd0236f883d49c98fca8 (diff) |
NFS : Handle buffer overflow in nfs3_create_exclusive.
Signed-off-by: Gaurav <gaurav@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2972 (Buffer overflow in nfs3_create_exclusive.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2972
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index e43b666d8..a40e47743 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -2437,8 +2437,10 @@ nfs3_create_exclusive (nfs3_call_state_t *cs) /* Storing verifier as a mtime and atime attribute, to store it * in stable storage */ - cs->stbuf.ia_atime = (cs->cookieverf & 0xFFFFFFFF00000000); - cs->stbuf.ia_mtime = (cs->cookieverf & 0x00000000FFFFFFFF); + memcpy (&cs->stbuf.ia_atime, &cs->cookieverf, sizeof (cs->stbuf.ia_atime)); + memcpy (&cs->stbuf.ia_mtime, + ((char *) &cs->cookieverf) + sizeof (cs->stbuf.ia_atime), + sizeof (cs->stbuf.ia_mtime)); cs->setattr_valid |= GF_SET_ATTR_ATIME; cs->setattr_valid |= GF_SET_ATTR_MTIME; nfs_request_user_init (&nfu, cs->req); |