Skip to content

Commit

Permalink
LibVNCClient: fix possible infinite loop
Browse files Browse the repository at this point in the history
Closes #251
  • Loading branch information
bk138 committed Sep 29, 2018
1 parent 2f5b2ad commit c311535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libvncclient/rfbproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ HandleRFBServerMessage(rfbClient* client)
/* Regardless of cause, do not divide by zero. */
linesToRead = bytesPerLine ? (RFB_BUFFER_SIZE / bytesPerLine) : 0;

while (h > 0) {
while (linesToRead && h > 0) {
if (linesToRead > h)
linesToRead = h;

Expand Down

0 comments on commit c311535

Please sign in to comment.