diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-05 13:16:32 +0000 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-01-13 22:00:29 +0100 |
commit | 0134e6723c9b100a8d56f9b079192a8609dd5ba0 (patch) | |
tree | 6442fae3f2ee75dba36a94f4358f47b388a7b8ec | |
parent | 3e05815c27e03c929d7d2f870d1ff8e898843127 (diff) |
Resolves: fdo#57532 restrict page sanity check to non-storage chunks
Change-Id: I47c24131e95b9a8a691dbff4710869ba91df8306
(cherry picked from commit 4a1044229afd6b52ca10e5c55f1957b153a8c6ea)
Reviewed-on: https://gerrit.libreoffice.org/1245
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r-- | sot/qa/cppunit/data/pass/fdo57532-1.compound | bin | 0 -> 25088 bytes | |||
-rw-r--r-- | sot/source/sdstor/stgelem.cxx | 2 |
2 files changed, 1 insertions, 1 deletions
diff --git a/sot/qa/cppunit/data/pass/fdo57532-1.compound b/sot/qa/cppunit/data/pass/fdo57532-1.compound Binary files differnew file mode 100644 index 000000000000..70068fe10c89 --- /dev/null +++ b/sot/qa/cppunit/data/pass/fdo57532-1.compound diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index c4a8c2881094..9b1c918aae25 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -405,7 +405,7 @@ sal_Bool StgEntry::Load( const void* pFrom, sal_uInt32 nBufSize ) if (n > nMaxLegalStr) return sal_False; - if ((nSize < 0 && cType != STG_STORAGE) || (nPage1 < 0 && !isKnownSpecial(nPage1))) + if ((cType != STG_STORAGE) && ((nSize < 0) || (nPage1 < 0 && !isKnownSpecial(nPage1)))) { // the size makes no sense for the substorage // TODO/LATER: actually the size should be an unsigned value, but in this case it would mean a stream of more than 2Gb |