Merge pull request #111 from zbierak/master

Fix buffer overflow when applying client encodings
pull/1/head
Christian Beier 8 years ago
commit 96a5111cba

@ -1492,7 +1492,8 @@ SetFormatAndEncodings(rfbClient* client)
if(e->encodings) { if(e->encodings) {
int* enc; int* enc;
for(enc = e->encodings; *enc; enc++) for(enc = e->encodings; *enc; enc++)
encs[se->nEncodings++] = rfbClientSwap32IfLE(*enc); if(se->nEncodings < MAX_ENCODINGS)
encs[se->nEncodings++] = rfbClientSwap32IfLE(*enc);
} }
len = sz_rfbSetEncodingsMsg + se->nEncodings * 4; len = sz_rfbSetEncodingsMsg + se->nEncodings * 4;

Loading…
Cancel
Save