diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-12-02 09:25:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-02 09:25:27 +0000 |
commit | fcf042b2163c29cdd426c7947fd55937981162b3 (patch) | |
tree | 88eb902e476fdaced56f169e9da58fd07443481f | |
parent | 316ef321ce2ad40e59d136f7c095e09a3fef9ca6 (diff) |
coverity#1394416 try and get it to see this bounds check
Change-Id: I007e9fb717d0da60c00aa14a4856075a6092148e
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 8b27a3fb24c4..c8c5a380ab9a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2550,11 +2550,12 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt, of the new data */ bool bExpand = IsExpandableSprm(nSpId); - const void* pEndAvailableData = maRawData + sizeof(maRawData); - if ((IsReplaceAllSprm(nSpId) || bExpand) && aEntry.mpData + 2 + sizeof(sal_uInt32) <= pEndAvailableData) + const sal_uInt8* pStartData = aEntry.mpData + 2; + const sal_uInt8* pLastValidDataPos = maRawData + sizeof(maRawData) - sizeof(sal_uInt32); + if ((IsReplaceAllSprm(nSpId) || bExpand) && pStartData <= pLastValidDataPos) { sal_uInt32 nCurr = pDataSt->Tell(); - sal_uInt32 nPos = SVBT32ToUInt32(aEntry.mpData + 2); + sal_uInt32 nPos = SVBT32ToUInt32(pStartData); sal_uInt16 nLen(0); bool bOk = checkSeek(*pDataSt, nPos); |