From 95dba6f085379ce8e07f316bc92c479956b5b221 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sat, 23 Jan 2010 00:46:16 +0000 Subject: 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 Signed-off-by: Anand V. Avati 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 --- xlators/protocol/server/src/server-protocol.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/protocol/server') 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]); -- cgit