diff options
author | Christian Beier <[email protected]> | 2018-09-29 21:32:59 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-03-03 16:04:38 +0100 |
commit | 90147500e0bad40ed39e5c978c523fad7a5f5f9f (patch) | |
tree | 6c5881d18a86492894da748e2cd00b6e53e3ed64 /krdc/vnc/rfbproto.c | |
parent | 20e7000d0cd56ab6e10d8f22b9caf922e655402c (diff) | |
download | tdenetwork-90147500e0bad40ed39e5c978c523fad7a5f5f9f.tar.gz tdenetwork-90147500e0bad40ed39e5c978c523fad7a5f5f9f.zip |
LibVNCClient: fix possible infinite loop
Closes #251
(cherry picked from commit c3115350eb8bb635d0fdb4dbbb0d0541f38ed19c)
Diffstat (limited to 'krdc/vnc/rfbproto.c')
-rw-r--r-- | krdc/vnc/rfbproto.c | 2 |
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; |