depot/third_party/nixpkgs/pkgs/tools/admin/tightvnc/1.3.10-CVE-2019-15678.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

18 lines
651 B
Diff

Adapted from https://github.com/LibVNC/libvncserver/commit/c5ba3fee85a7ecbbca1df5ffd46d32b92757bc2a
diff --git a/vncviewer/rfbproto.c b/vncviewer/rfbproto.c
index 04b0230..47a6863 100644
--- a/vncviewer/rfbproto.c
+++ b/vncviewer/rfbproto.c
@@ -1217,6 +1217,12 @@ HandleRFBServerMessage()
if (serverCutText)
free(serverCutText);
+ if (msg.sct.length > 1<<20) {
+ fprintf(stderr,"Ignoring too big cut text length sent by server: %u B > 1 MB\n",
+ (unsigned int)msg.sct.length);
+ return False;
+ }
+
serverCutText = malloc(msg.sct.length+1);
if (!ReadFromRFBServer(serverCutText, msg.sct.length))