summaryrefslogtreecommitdiffstats
path: root/krdc/vnc
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2018-09-29 21:32:59 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-03-03 16:04:38 +0100
commit90147500e0bad40ed39e5c978c523fad7a5f5f9f (patch)
tree6c5881d18a86492894da748e2cd00b6e53e3ed64 /krdc/vnc
parent20e7000d0cd56ab6e10d8f22b9caf922e655402c (diff)
downloadtdenetwork-90147500e0bad40ed39e5c978c523fad7a5f5f9f.tar.gz
tdenetwork-90147500e0bad40ed39e5c978c523fad7a5f5f9f.zip
LibVNCClient: fix possible infinite loop
Closes #251 (cherry picked from commit c3115350eb8bb635d0fdb4dbbb0d0541f38ed19c)
Diffstat (limited to 'krdc/vnc')
-rw-r--r--krdc/vnc/rfbproto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/krdc/vnc/rfbproto.c b/krdc/vnc/rfbproto.c
index c6e05c05..a178ed6f 100644
--- a/krdc/vnc/rfbproto.c
+++ b/krdc/vnc/rfbproto.c
@@ -987,7 +987,7 @@ HandleRFBServerMessage()
/* Regardless of cause, do not divide by zero. */
linesToRead = bytesPerLine ? (BUFFER_SIZE / bytesPerLine) : 0;
- while (rect.r.h > 0) {
+ while (linesToRead && rect.r.h > 0) {
if (linesToRead > rect.r.h)
linesToRead = rect.r.h;