summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-01-23 00:46:16 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-22 23:01:48 -0800
commit95dba6f085379ce8e07f316bc92c479956b5b221 (patch)
tree968ee2b9cbdd7b7a651eb2c873f548c7361804d1 /xlators/protocol/server
parent375f08e1b56f61c5687bb276fb95bea230085f77 (diff)
protocol/server: handle group id decoding in a stricter way
This causes crash between 3.0.x servers and 2.0.x clients Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 564 (3.0.1rc3 server daemon crashes when any of the 2.0.x version client connects) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=564
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r--xlators/protocol/server/src/server-protocol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c
index d9229e0d8c3..0528699acbe 100644
--- a/xlators/protocol/server/src/server-protocol.c
+++ b/xlators/protocol/server/src/server-protocol.c
@@ -6121,6 +6121,9 @@ server_decode_groups (call_frame_t *frame, gf_hdr_common_t *hdr)
if (frame->root->ngrps == 0)
return 0;
+ if (frame->root->ngrps > GF_REQUEST_MAXGROUPS)
+ return -1;
+
for (; i < frame->root->ngrps; ++i)
frame->root->groups[i] = ntoh32 (hdr->req.groups[i]);