We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c092e5 commit 8937203Copy full SHA for 8937203
libvncclient/rfbproto.c
@@ -65,6 +65,7 @@
65
#endif
66
#include "tls.h"
67
68
+#define MAX_TEXTCHAT_SIZE 10485760 /* 10MB */
69
70
/*
71
* rfbClientLog prints a time-stamped message to the log file (stderr).
@@ -2159,6 +2160,8 @@ HandleRFBServerMessage(rfbClient* client)
2159
2160
client->HandleTextChat(client, (int)rfbTextChatFinished, NULL);
2161
break;
2162
default:
2163
+ if(msg.tc.length > MAX_TEXTCHAT_SIZE)
2164
+ return FALSE;
2165
buffer=malloc(msg.tc.length+1);
2166
if (!ReadFromRFBServer(client, buffer, msg.tc.length))
2167
{
0 commit comments