Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f2f6bf1c
Kaydet (Commit)
f2f6bf1c
authored
Kas 25, 2010
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: rhbz#656191 Catch bad alloc and convert to ZipIOException
üst
41a0d247
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
ZipFile.cxx
package/source/zipapi/ZipFile.cxx
+27
-18
No files found.
package/source/zipapi/ZipFile.cxx
Dosyayı görüntüle @
f2f6bf1c
...
@@ -638,29 +638,38 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
...
@@ -638,29 +638,38 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
aGrabber
>>
nExtraLen
;
aGrabber
>>
nExtraLen
;
rEntry
.
nOffset
=
static_cast
<
sal_Int32
>
(
aGrabber
.
getPosition
())
+
nPathLen
+
nExtraLen
;
rEntry
.
nOffset
=
static_cast
<
sal_Int32
>
(
aGrabber
.
getPosition
())
+
nPathLen
+
nExtraLen
;
// read always in UTF8, some tools seem not to set UTF8 bit
sal_Bool
bBroken
=
sal_False
;
uno
::
Sequence
<
sal_Int8
>
aNameBuffer
(
nPathLen
);
sal_Int32
nRead
=
aGrabber
.
readBytes
(
aNameBuffer
,
nPathLen
);
if
(
nRead
<
aNameBuffer
.
getLength
()
)
aNameBuffer
.
realloc
(
nRead
);
::
rtl
::
OUString
sLOCPath
=
rtl
::
OUString
::
intern
(
(
sal_Char
*
)
aNameBuffer
.
getArray
(),
try
aNameBuffer
.
getLength
(),
{
RTL_TEXTENCODING_UTF8
);
// read always in UTF8, some tools seem not to set UTF8 bit
uno
::
Sequence
<
sal_Int8
>
aNameBuffer
(
nPathLen
);
sal_Int32
nRead
=
aGrabber
.
readBytes
(
aNameBuffer
,
nPathLen
);
if
(
nRead
<
aNameBuffer
.
getLength
()
)
aNameBuffer
.
realloc
(
nRead
);
::
rtl
::
OUString
sLOCPath
=
rtl
::
OUString
::
intern
(
(
sal_Char
*
)
aNameBuffer
.
getArray
(),
aNameBuffer
.
getLength
(),
RTL_TEXTENCODING_UTF8
);
if
(
rEntry
.
nPathLen
==
-
1
)
// the file was created
{
rEntry
.
nPathLen
=
nPathLen
;
rEntry
.
sPath
=
sLOCPath
;
}
if
(
rEntry
.
nPathLen
==
-
1
)
// the file was created
// the method can be reset for internal use so it is not checked
bBroken
=
rEntry
.
nVersion
!=
nVersion
||
rEntry
.
nFlag
!=
nFlag
||
rEntry
.
nTime
!=
nTime
||
rEntry
.
nPathLen
!=
nPathLen
||
!
rEntry
.
sPath
.
equals
(
sLOCPath
);
}
catch
(
::
std
::
bad_alloc
&
)
{
{
rEntry
.
nPathLen
=
nPathLen
;
bBroken
=
sal_True
;
rEntry
.
sPath
=
sLOCPath
;
}
}
// the method can be reset for internal use so it is not checked
sal_Bool
bBroken
=
rEntry
.
nVersion
!=
nVersion
||
rEntry
.
nFlag
!=
nFlag
||
rEntry
.
nTime
!=
nTime
||
rEntry
.
nPathLen
!=
nPathLen
||
!
rEntry
.
sPath
.
equals
(
sLOCPath
);
if
(
bBroken
&&
!
bRecoveryMode
)
if
(
bBroken
&&
!
bRecoveryMode
)
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
),
throw
ZipIOException
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"The stream seems to be broken!"
)
),
Reference
<
XInterface
>
()
);
Reference
<
XInterface
>
()
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment