summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2018-09-29 21:32:59 +0200
committerChristian Beier <dontmind@freeshell.org>2018-09-29 21:32:59 +0200
commitc3115350eb8bb635d0fdb4dbbb0d0541f38ed19c (patch)
tree68cab2ae957dfe142d7cf08d58e518f2ad02b957 /libvncclient
parent2f5b2ad1c6c99b1ac6482c95844a84d66bb52838 (diff)
downloadlibtdevnc-c3115350eb8bb635d0fdb4dbbb0d0541f38ed19c.tar.gz
libtdevnc-c3115350eb8bb635d0fdb4dbbb0d0541f38ed19c.zip
LibVNCClient: fix possible infinite loop
Closes #251
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/rfbproto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index 808ad4d..8d6a4c1 100644
--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -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;