Blame SOURCES/libvncserver-0.9.11-CVE-2020-14405.patch

217285
From 483dd0834167b86833ec6d756168b426ff8b4304 Mon Sep 17 00:00:00 2001
217285
From: Christian Beier <dontmind@freeshell.org>
217285
Date: Tue, 3 Nov 2020 13:44:14 -0600
217285
Subject: [PATCH] libvncclient/rfbproto: limit max textchat size
217285
217285
Addresses GitHub Security Lab (GHSL) Vulnerability Report
217285
`GHSL-2020-063`.
217285
217285
Re #275
217285
---
217285
 libvncclient/rfbproto.c | 4 ++++
217285
 1 file changed, 4 insertions(+)
217285
217285
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
217285
index 94751a22..7ba00b55 100644
217285
--- a/libvncclient/rfbproto.c
217285
+++ b/libvncclient/rfbproto.c
217285
@@ -73,6 +73,8 @@
217285
 #  define snprintf _snprintf /* MSVC went straight to the underscored syntax */
217285
 #endif
217285
 
217285
+#define MAX_TEXTCHAT_SIZE 10485760 /* 10MB */
217285
+
217285
 /*
217285
  * rfbClientLog prints a time-stamped message to the log file (stderr).
217285
  */
217285
@@ -2285,6 +2287,8 @@ HandleRFBServerMessage(rfbClient* client)
217285
               client->HandleTextChat(client, (int)rfbTextChatFinished, NULL);
217285
           break;
217285
       default:
217285
+         if(msg.tc.length > MAX_TEXTCHAT_SIZE)
217285
+             return FALSE;
217285
           buffer=malloc(msg.tc.length+1);
217285
           if (!ReadFromRFBServer(client, buffer, msg.tc.length))
217285
           {
217285
-- 
217285
2.28.0
217285