diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-28 13:05:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-28 13:26:11 +0100 |
commit | e2f3312ea2e547fbca7e131ed7824b1de4573b43 (patch) | |
tree | 5eb6e5762beec00aeaa50c57ea660f4df9f328bb /package | |
parent | 8c205bfccdf625d70cfc9fcf617f89548c1521b1 (diff) |
throw earlier on broken zip streams
Change-Id: I0de705b4c6a9176e98baed21b2cd960d4d091563
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zipapi/XUnbufferedStream.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index 9f289baab86e..d028c147c76d 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -78,6 +78,10 @@ XUnbufferedStream::XUnbufferedStream( mnZipSize = maEntry.nSize; mnZipEnd = maEntry.nMethod == DEFLATED ? maEntry.nOffset + maEntry.nCompressedSize : maEntry.nOffset + maEntry.nSize; } + + if (mnZipSize < 0) + throw ZipIOException(OUString("The stream seems to be broken!"), uno::Reference< XInterface >()); + sal_Bool bHaveEncryptData = ( rData.is() && rData->m_aSalt.getLength() && rData->m_aInitVector.getLength() && rData->m_nIterationCount != 0 ) ? sal_True : sal_False; sal_Bool bMustDecrypt = ( nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False; |