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
11a514e0
Kaydet (Commit)
11a514e0
authored
Eki 17, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1242573 Untrusted loop bound
Change-Id: Ic84e57fbfa2b532409865c4364b91be594d252cf
üst
5e2d089f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
12 deletions
+58
-12
winwmf.cxx
vcl/source/filter/wmf/winwmf.cxx
+58
-12
No files found.
vcl/source/filter/wmf/winwmf.cxx
Dosyayı görüntüle @
11a514e0
...
...
@@ -1462,12 +1462,31 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
case
W_META_POLYGON
:
{
sal_uInt16
nPoints
;
bool
bRecordOk
=
true
;
sal_uInt16
nPoints
(
0
);
pStm
->
ReadUInt16
(
nPoints
);
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
i
++
)
if
(
nPoints
>
pStm
->
remainingSize
()
/
(
2
*
sizeof
(
sal_uInt16
)))
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
bRecordOk
=
false
;
}
else
{
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
i
++
)
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
}
}
SAL_WARN_IF
(
!
bRecordOk
,
"vcl.wmf"
,
"polyline record claimed more points than the stream can provide"
);
if
(
!
bRecordOk
)
{
pStm
->
SetError
(
SVSTREAM_FILEFORMAT_ERROR
);
bRet
=
false
;
break
;
}
}
break
;
...
...
@@ -1507,12 +1526,21 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
break
;
}
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
i
++
)
if
(
nPoints
>
pStm
->
remainingSize
()
/
(
2
*
sizeof
(
sal_uInt16
))
)
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
bRecordOk
=
false
;
}
else
{
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
i
++
)
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
}
}
SAL_WARN_IF
(
!
bRecordOk
,
"vcl.wmf"
,
"polypolygon record claimed more points than the stream can provide"
);
bRecordOk
&=
pStm
->
good
();
if
(
!
bRecordOk
)
...
...
@@ -1526,12 +1554,30 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
case
W_META_POLYLINE
:
{
sal_uInt16
nPoints
;
pStm
->
ReadUInt16
(
nPoints
);
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
i
++
)
bool
bRecordOk
=
true
;
sal_uInt16
nPoints
(
0
);
pStm
->
ReadUInt16
(
nPoints
);
if
(
nPoints
>
pStm
->
remainingSize
()
/
(
2
*
sizeof
(
sal_uInt16
)))
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
bRecordOk
=
false
;
}
else
{
for
(
sal_uInt16
i
=
0
;
i
<
nPoints
;
++
i
)
{
GetWinExtMax
(
ReadPoint
(),
aBound
,
nMapMode
);
bBoundsDetermined
=
true
;
}
}
SAL_WARN_IF
(
!
bRecordOk
,
"vcl.wmf"
,
"polyline record claimed more points than the stream can provide"
);
if
(
!
bRecordOk
)
{
pStm
->
SetError
(
SVSTREAM_FILEFORMAT_ERROR
);
bRet
=
false
;
break
;
}
}
break
;
...
...
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