Fix buffer overflow when applying client encodings

pull/1/head
zbierak 7 years ago
parent 5ceccb0dfa
commit 9b82dee3a4
  1. 3
      libvncclient/rfbproto.c

@ -1492,7 +1492,8 @@ SetFormatAndEncodings(rfbClient* client)
if(e->encodings) {
int* 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;

Loading…
Cancel
Save