From e3f42ed398cad909e9b21cc49cbcc41ff16b81ce Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Thu, 27 Aug 2026 08:15:29 -0400 Subject: [PATCH] fix(clipboard): check oob for clipboard before reading number of formats --- src/lib/deskflow/IClipboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/deskflow/IClipboard.cpp b/src/lib/deskflow/IClipboard.cpp index 2c23f8663..d4394f7d4 100644 --- a/src/lib/deskflow/IClipboard.cpp +++ b/src/lib/deskflow/IClipboard.cpp @@ -27,13 +27,13 @@ void IClipboard::unmarshall(IClipboard *clipboard, const std::string_view &data, // clear existing data clipboard->empty(); - // read the number of formats - const uint32_t numFormats = readUInt32(index); if (end - index < 4) { LOG_ERR("clipboard unmarshall: truncated header"); clipboard->close(); return; } + // read the number of formats + const uint32_t numFormats = readUInt32(index); index += 4; // read each format