summaryrefslogtreecommitdiff
path: root/package/source/zipapi/ZipFile.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-07-01 14:11:54 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-07-01 14:11:54 +0000
commitb9ba8a917d8ae5b9460dfa9cf2ecdc1d3d1c231b (patch)
treefc68de5789ced89bae55dba673603874e7f2ccc0 /package/source/zipapi/ZipFile.cxx
parent53ccab4547d7e283f95f96fa1cadbf001fab4f86 (diff)
INTEGRATION: CWS sw019 (1.38.14); FILE MERGED
2003/06/30 14:48:45 mav 1.38.14.1: #110534# negative values are possible in case of corrupted stream
Diffstat (limited to 'package/source/zipapi/ZipFile.cxx')
-rw-r--r--package/source/zipapi/ZipFile.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 8329bd603..0bbccada9 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ZipFile.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: hr $ $Date: 2003-04-28 15:46:49 $
+ * last change: $Author: vg $ $Date: 2003-07-01 15:11:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -757,11 +757,21 @@ sal_Int32 ZipFile::recover()
( aEntry.nMethod == DEFLATED && ( aEntry.nFlag & 8 ) ) ?
16 : 0;
+
+ // This is a quick fix for OOo1.1RC
+ // For OOo2.0 the whole package must be switched to unsigned values
+ if ( aEntry.nCompressedSize < 0 ) aEntry.nCompressedSize = 0x7FFFFFFF;
+ if ( aEntry.nSize < 0 ) aEntry.nSize = 0x7FFFFFFF;
+ if ( aEntry.nNameLen < 0 ) aEntry.nNameLen = 0x7FFF;
+ if ( aEntry.nExtraLen < 0 ) aEntry.nExtraLen = 0x7FFF;
+ // End of quick fix
+
+
sal_Int32 nBlockLength = aEntry.nSize + aEntry.nNameLen + aEntry.nExtraLen + 30 + nDescrLength;
if ( aEntry.nNameLen <= ZIP_MAXNAMELEN && aEntry.nExtraLen < ZIP_MAXEXTRA
&& ( nGenPos + nPos + nBlockLength ) <= nLength )
{
- if( nPos + 30 + aEntry.nNameLen <= 32000 )
+ if( nPos + 30 + aEntry.nNameLen <= nBufSize )
aEntry.sName = OUString ( (sal_Char *) &pBuffer[nPos + 30],
aEntry.nNameLen,
RTL_TEXTENCODING_ASCII_US);