fix(clipboard): check oob for clipboard before reading number of formats
This commit is contained in:
parent
fdc61ac3cd
commit
e3f42ed398
1 changed files with 2 additions and 2 deletions
|
|
@ -27,13 +27,13 @@ void IClipboard::unmarshall(IClipboard *clipboard, const std::string_view &data,
|
||||||
// clear existing data
|
// clear existing data
|
||||||
clipboard->empty();
|
clipboard->empty();
|
||||||
|
|
||||||
// read the number of formats
|
|
||||||
const uint32_t numFormats = readUInt32(index);
|
|
||||||
if (end - index < 4) {
|
if (end - index < 4) {
|
||||||
LOG_ERR("clipboard unmarshall: truncated header");
|
LOG_ERR("clipboard unmarshall: truncated header");
|
||||||
clipboard->close();
|
clipboard->close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// read the number of formats
|
||||||
|
const uint32_t numFormats = readUInt32(index);
|
||||||
index += 4;
|
index += 4;
|
||||||
|
|
||||||
// read each format
|
// read each format
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue