]> source.dussan.org Git - tigervnc.git/commitdiff
Reject too large screen resize requests
authorPierre Ossman <ossman@cendio.se>
Sat, 23 May 2020 10:17:55 +0000 (12:17 +0200)
committerPierre Ossman <ossman@cendio.se>
Sat, 23 May 2020 10:17:55 +0000 (12:17 +0200)
We'll just crash later if we try to use such a large screen, so reject
the request from the client instead and keep the server running.

common/rfb/VNCServerST.cxx

index b3cc7a1f91b35aeed34de295279fa4c5b286eaaf..8329bb230d4ec8741585efc372d9144783af2ada 100644 (file)
@@ -527,6 +527,11 @@ unsigned int VNCServerST::setDesktopSize(VNCSConnectionST* requester,
   unsigned int result;
   std::list<VNCSConnectionST*>::iterator ci, ci_next;
 
+  // We can't handle a framebuffer larger than this, so don't let a
+  // client set one (see PixelBuffer.cxx)
+  if ((fb_width > 16384) || (fb_height > 16384))
+    return resultProhibited;
+
   // Don't bother the desktop with an invalid configuration
   if (!layout.validate(fb_width, fb_height))
     return resultInvalid;