File LibVNCServer-CVE-2018-20021.patch of Package LibVNCServer.25862
Index: libvncserver-LibVNCServer-0.9.10/libvncclient/rfbproto.c
===================================================================
--- libvncserver-LibVNCServer-0.9.10.orig/libvncclient/rfbproto.c 2019-01-03 17:21:11.262257813 +0100
+++ libvncserver-LibVNCServer-0.9.10/libvncclient/rfbproto.c 2019-01-03 17:21:48.098436189 +0100
@@ -1944,7 +1944,7 @@ HandleRFBServerMessage(rfbClient* client
bytesPerLine = rect.r.w * client->format.bitsPerPixel / 8;
linesToRead = RFB_BUFFER_SIZE / bytesPerLine;
- while (h > 0) {
+ while (linesToRead && h > 0) {
if (linesToRead > h)
linesToRead = h;