summary refs log tree commit diff
path: root/pkgs/tools/admin/tightvnc/1.3.10-CVE-2019-8287.patch
blob: 5bfd1b9ea87fbb2451eec878f4dccc8e89e66f47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Adapted from https://github.com/LibVNC/libvncserver/commit/7b1ef0ffc4815cab9a96c7278394152bdc89dc4d
diff --git a/vncviewer/corre.c b/vncviewer/corre.c
index c846a10..a4c272d 100644
--- a/vncviewer/corre.c
+++ b/vncviewer/corre.c
@@ -56,7 +56,7 @@ HandleCoRREBPP (int rx, int ry, int rw, int rh)
     XChangeGC(dpy, gc, GCForeground, &gcv);
     XFillRectangle(dpy, desktopWin, gc, rx, ry, rw, rh);
 
-    if (!ReadFromRFBServer(buffer, hdr.nSubrects * (4 + (BPP / 8))))
+    if (hdr.nSubrects > BUFFER_SIZE / (4 + (BPP / 8)) || !ReadFromRFBServer(buffer, hdr.nSubrects * (4 + (BPP / 8))))
 	return False;
 
     ptr = (CARD8 *)buffer;