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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user