]> source.dussan.org Git - tigervnc.git/commitdiff
Don't parse empty fence messages
authorPierre Ossman <ossman@cendio.se>
Thu, 23 Feb 2023 06:19:09 +0000 (07:19 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 12 Aug 2024 14:21:37 +0000 (16:21 +0200)
We need to return here or we'll do an out-of-bounds access on the data
array.

common/rfb/VNCSConnectionST.cxx

index a40a1a30e2157750b3f327c96206e2aa6dd8a450..d20da8cb61cd1676127e4d59b22800bebeb1743a 100644 (file)
@@ -706,8 +706,10 @@ void VNCSConnectionST::fence(uint32_t flags, unsigned len, const uint8_t data[])
     return;
   }
 
-  if (len < 1)
+  if (len < 1) {
     vlog.error("Fence response of unexpected size received");
+    return;
+  }
 
   type = data[0];