check if the readBytes could be satisfied

Change-Id: I1db61c215963882754a775ddd502d47378c7ef81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202522
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2026-03-24 09:12:08 +01:00
parent 4e5fbf0a91
commit 1ceac1a378
+10 -7
View File
@@ -760,14 +760,17 @@ namespace
nRead = xIn->readBytes(aData, 1);
} while (nRead == 1 && aData[0] != 0); // Actual string representing the file path
uno::Sequence< sal_Int8 > aLenData(4);
xIn->readBytes(aLenData, 4); //len of attachment
sal_uInt32 nLen = static_cast<sal_uInt32>(
(aLenData[0] & 0xFF) |
((aLenData[1] & 0xFF) << 8) |
((aLenData[2] & 0xFF) << 16) |
((aLenData[3] & 0xFF) << 24));
nRead = xIn->readBytes(aLenData, 4); //len of attachment
if (nRead == 4)
{
sal_uInt32 nLen = static_cast<sal_uInt32>(
(aLenData[0] & 0xFF) |
((aLenData[1] & 0xFF) << 8) |
((aLenData[2] & 0xFF) << 16) |
((aLenData[3] & 0xFF) << 24));
bCopied = lcl_CopyStream(xIn, xStream->getOutputStream(), nLen);
bCopied = lcl_CopyStream(xIn, xStream->getOutputStream(), nLen);
}
}
}