]> 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)
committerLinn Mattsson <linma@cendio.se>
Fri, 18 Oct 2024 09:03:47 +0000 (11:03 +0200)
We need to return here or we'll do an out-of-bounds access on the data
array.

(cherry picked from commit 7af69eb4a7a52d6baf4d09f79ccbec76bd1fcee1)

common/rfb/VNCSConnectionST.cxx

index 306bba1dc402dfc0dbc7264e7d8df1cb7632922e..758744952535c2c31fd5cc4f1df296cc1fe2f559 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];