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
174563af
Kaydet (Commit)
174563af
authored
Mar 28, 2014
tarafından
Jürgen Schmidt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#124461# merge from aoo410 branch, add checks for nested depth and entry indices
üst
52c89c2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
stgdir.cxx
sot/source/sdstor/stgdir.cxx
+23
-5
stgdir.hxx
sot/source/sdstor/stgdir.hxx
+5
-1
No files found.
sot/source/sdstor/stgdir.cxx
Dosyayı görüntüle @
174563af
...
@@ -827,7 +827,7 @@ StgDirStrm::StgDirStrm( StgIo& r )
...
@@ -827,7 +827,7 @@ StgDirStrm::StgDirStrm( StgIo& r )
// temporarily use this instance as owner, so
// temporarily use this instance as owner, so
// the TOC pages can be removed.
// the TOC pages can be removed.
pEntry
=
(
StgDirEntry
*
)
this
;
// just for a bit pattern
pEntry
=
(
StgDirEntry
*
)
this
;
// just for a bit pattern
SetupEntry
(
0
,
pRoot
);
SetupEntry
(
0
,
pRoot
,
nSize
/
STGENTRY_SIZE
,
0
);
rIo
.
Revert
(
pEntry
);
rIo
.
Revert
(
pEntry
);
pEntry
=
NULL
;
pEntry
=
NULL
;
}
}
...
@@ -840,8 +840,26 @@ StgDirStrm::~StgDirStrm()
...
@@ -840,8 +840,26 @@ StgDirStrm::~StgDirStrm()
// Recursively parse the directory tree during reading the TOC stream
// Recursively parse the directory tree during reading the TOC stream
void
StgDirStrm
::
SetupEntry
(
sal_Int32
n
,
StgDirEntry
*
pUpper
)
void
StgDirStrm
::
SetupEntry
(
const
sal_Int32
n
,
StgDirEntry
*
pUpper
,
const
sal_Int32
nEntryCount
,
const
sal_Int32
nDepth
)
{
{
if
(
nDepth
>=
nEntryCount
)
{
// Tree grew higher than there are different nodes. Looks like
// something is wrong with the file. Return now to avoid
// infinite recursion.
return
;
}
else
if
(
n
>=
nEntryCount
||
(
n
<
0
&&
n
!=
STG_FREE
))
{
// n has an invalid value. Don't access the corresponding
// stream content.
return
;
}
void
*
p
=
(
n
==
STG_FREE
)
?
NULL
:
GetEntry
(
n
);
void
*
p
=
(
n
==
STG_FREE
)
?
NULL
:
GetEntry
(
n
);
if
(
p
)
if
(
p
)
{
{
...
@@ -889,9 +907,9 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
...
@@ -889,9 +907,9 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
delete
pCur
;
pCur
=
NULL
;
delete
pCur
;
pCur
=
NULL
;
return
;
return
;
}
}
SetupEntry
(
nLeft
,
pUpper
);
SetupEntry
(
nLeft
,
pUpper
,
nEntryCount
,
nDepth
+
1
);
SetupEntry
(
nRight
,
pUpper
);
SetupEntry
(
nRight
,
pUpper
,
nEntryCount
,
nDepth
+
1
);
SetupEntry
(
nLeaf
,
pCur
);
SetupEntry
(
nLeaf
,
pCur
,
nEntryCount
,
nDepth
+
1
);
}
}
}
}
}
}
...
...
sot/source/sdstor/stgdir.hxx
Dosyayı görüntüle @
174563af
...
@@ -100,7 +100,11 @@ class StgDirStrm : public StgDataStrm
...
@@ -100,7 +100,11 @@ class StgDirStrm : public StgDataStrm
friend
class
StgIterator
;
friend
class
StgIterator
;
StgDirEntry
*
pRoot
;
// root of dir tree
StgDirEntry
*
pRoot
;
// root of dir tree
short
nEntries
;
// entries per page
short
nEntries
;
// entries per page
void
SetupEntry
(
sal_Int32
,
StgDirEntry
*
);
void
SetupEntry
(
const
sal_Int32
n
,
StgDirEntry
*
pUpper
,
const
sal_Int32
nEntryCount
,
const
sal_Int32
nDepth
);
public
:
public
:
StgDirStrm
(
StgIo
&
);
StgDirStrm
(
StgIo
&
);
~
StgDirStrm
();
~
StgDirStrm
();
...
...
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