summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorHarpreet Kaur <hlalwani@redhat.com>2018-12-14 13:12:26 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-26 02:17:16 +0000
commitd64fdf867fef36422ab84f2918f5d925597bc7d4 (patch)
treeede3904bb3393f87f5cbe381e7208f28194cfacd /xlators/protocol
parent8fe3c6107a2b431d7cc0b8cfaeeb7941cf9590f9 (diff)
posix: stack-buffer-overflow reported by asan
This patch fixes buffer overflow in $SRC/xlators/storage/posix/src/posix-inode-fd-ops.c Memory access at offset 432 overflows "md5_checksum" variable. SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.5+0xb825a) updates: bz#1633930 Change-Id: I46010a09161d02cdf0c69679a334ec1d3d49cffb Signed-off-by: Harpreet Kaur <hlalwani@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c
index 0639ac3feb3..ce7f264dd80 100644
--- a/xlators/protocol/server/src/server-common.c
+++ b/xlators/protocol/server/src/server-common.c
@@ -656,7 +656,8 @@ server4_post_rchecksum(gfx_rchecksum_rsp *rsp, uint32_t weak_checksum,
uint8_t *strong_checksum)
{
rsp->weak_checksum = weak_checksum;
-
+ /* When the length encoding changes, update the change
+ in posix code also. */
rsp->strong_checksum.strong_checksum_val = (char *)strong_checksum;
rsp->strong_checksum.strong_checksum_len = SHA256_DIGEST_LENGTH;
rsp->flags = 1; /* Indicates SHA256 TYPE */