Skip to content

Commit 01cdb04

Browse files
committed
libvncclient: guard against heap overflow in Tight encoding
Spotted by Lukas Kupczyk, thanks!
1 parent b4199d5 commit 01cdb04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libvncclient/tight.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ HandleTightBPP (rfbClient* client, int rx, int ry, int rw, int rh)
225225
return FALSE;
226226
}
227227
if (readUncompressed) {
228+
if (compressedLen > RFB_BUFFER_SIZE) {
229+
rfbClientErr("Received uncompressed byte count exceeds our buffer size.\n");
230+
return FALSE;
231+
}
232+
228233
if (!ReadFromRFBServer(client, (char*)client->buffer, compressedLen))
229234
return FALSE;
230235

0 commit comments

Comments
 (0)