Skip to content

Commit

Permalink
Don't parse empty fence messages
Browse files Browse the repository at this point in the history
We need to return here or we'll do an out-of-bounds access on the data
array.

(cherry picked from commit 7af69eb)
  • Loading branch information
CendioOssman authored and LMattsson committed Oct 18, 2024
1 parent bda9385 commit 4b859ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/rfb/VNCSConnectionST.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 4b859ca

Please sign in to comment.