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
This commit is contained in:
Anand Avati 2010-01-23 00:46:16 +00:00 committed by Anand V. Avati
parent 375f08e1b5
commit 95dba6f085

View File

@ -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]);