summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/rfbproto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index 187a56a..fa46578 100644
--- a/libvncclient/rfbproto.c
+++ b/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;