check if the readBytes could be satisfied

Change-Id: I1db61c215963882754a775ddd502d47378c7ef81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202523
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Caolán McNamara
2026-03-24 10:57:32 +01:00
committed by Xisco Fauli
parent 9a9743bfab
commit 2565dd2cbf
+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);
}
}
}