Kaydet (Commit) b3cd47bd authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#92772 missing shape bg color

regression from dcad3ac4

    coverity#1242624 Untrusted loop bound

    Change-Id: Idf52c09828c2bab767e9ff0d07b61befd6bfc64b

The original code read 8 bytes on the nElemSizeVert == 8
branch and always 4 otherwise. I assumed that nElemSizeVert had
to be read as 4 on that branch, but apparently not. So if its
not 4, set it to 4 and we get the same behaviour as originally
and continue to ensure we bounds check the loop

Change-Id: Ica8ab7cc3bbebee93216766a2e1279a579494840
üst 33255f97
......@@ -2153,12 +2153,10 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt
sal_uInt16 nNumElemMemVert = 0;
rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert );
}
bool bImport = false;
if (nElemSizeVert == 8 || nElemSizeVert == 4)
{
//sanity check that the stream is long enough to fulfill nNumElem * nElemSize;
bImport = rIn.remainingSize() / nElemSizeVert >= nNumElemVert;
}
if (nElemSizeVert != 8)
nElemSizeVert = 4;
//sanity check that the stream is long enough to fulfill nNumElem * nElemSize;
bool bImport = rIn.remainingSize() / nElemSizeVert >= nNumElemVert;
if (bImport)
{
aCoordinates.realloc( nNumElemVert );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment