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
e46e041c
Kaydet (Commit)
e46e041c
authored
Eyl 11, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reject invalid dbase files with 0 len db_slng right at the start
Change-Id: If4aa5249391ea2d2e475fa3ebaccf4e9fc7442de
üst
e7fb96a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
DTable.cxx
connectivity/source/drivers/dbase/DTable.cxx
+10
-5
DTable.hxx
connectivity/source/inc/dbase/DTable.hxx
+1
-1
sf_8acee7303920116c1f58c9d0e669855f-7551-minimized.wks
...il/sf_8acee7303920116c1f58c9d0e669855f-7551-minimized.wks
+0
-0
No files found.
connectivity/source/drivers/dbase/DTable.cxx
Dosyayı görüntüle @
e46e041c
...
@@ -214,6 +214,8 @@ void ODbaseTable::readHeader()
...
@@ -214,6 +214,8 @@ void ODbaseTable::readHeader()
(
*
m_pFileStream
).
ReadUInt16
(
m_aHeader
.
db_slng
);
(
*
m_pFileStream
).
ReadUInt16
(
m_aHeader
.
db_slng
);
if
(
ERRCODE_NONE
!=
m_pFileStream
->
GetErrorCode
())
if
(
ERRCODE_NONE
!=
m_pFileStream
->
GetErrorCode
())
throwInvalidDbaseFormat
();
throwInvalidDbaseFormat
();
if
(
m_aHeader
.
db_slng
==
0
)
throwInvalidDbaseFormat
();
m_pFileStream
->
Read
((
char
*
)(
&
m_aHeader
.
db_frei
),
20
*
sizeof
(
sal_uInt8
));
m_pFileStream
->
Read
((
char
*
)(
&
m_aHeader
.
db_frei
),
20
*
sizeof
(
sal_uInt8
));
if
(
ERRCODE_NONE
!=
m_pFileStream
->
GetErrorCode
())
if
(
ERRCODE_NONE
!=
m_pFileStream
->
GetErrorCode
())
throwInvalidDbaseFormat
();
throwInvalidDbaseFormat
();
...
@@ -1497,9 +1499,9 @@ bool ODbaseTable::DropImpl()
...
@@ -1497,9 +1499,9 @@ bool ODbaseTable::DropImpl()
bool
ODbaseTable
::
InsertRow
(
OValueRefVector
&
rRow
,
bool
bFlush
,
const
Reference
<
XIndexAccess
>&
_xCols
)
bool
ODbaseTable
::
InsertRow
(
OValueRefVector
&
rRow
,
bool
bFlush
,
const
Reference
<
XIndexAccess
>&
_xCols
)
{
{
// fill buffer with blanks
// fill buffer with blanks
AllocBuffer
();
if
(
!
AllocBuffer
())
if
(
!
m_pBuffer
)
return
false
;
return
false
;
memset
(
m_pBuffer
,
0
,
m_aHeader
.
db_slng
);
memset
(
m_pBuffer
,
0
,
m_aHeader
.
db_slng
);
m_pBuffer
[
0
]
=
' '
;
m_pBuffer
[
0
]
=
' '
;
...
@@ -1556,7 +1558,8 @@ bool ODbaseTable::InsertRow(OValueRefVector& rRow, bool bFlush, const Reference<
...
@@ -1556,7 +1558,8 @@ bool ODbaseTable::InsertRow(OValueRefVector& rRow, bool bFlush, const Reference<
bool
ODbaseTable
::
UpdateRow
(
OValueRefVector
&
rRow
,
OValueRefRow
&
pOrgRow
,
const
Reference
<
XIndexAccess
>&
_xCols
)
bool
ODbaseTable
::
UpdateRow
(
OValueRefVector
&
rRow
,
OValueRefRow
&
pOrgRow
,
const
Reference
<
XIndexAccess
>&
_xCols
)
{
{
// fill buffer with blanks
// fill buffer with blanks
AllocBuffer
();
if
(
!
AllocBuffer
())
return
false
;
// position on desired record:
// position on desired record:
sal_Size
nPos
=
m_aHeader
.
db_kopf
+
(
long
)(
m_nFilePos
-
1
)
*
m_aHeader
.
db_slng
;
sal_Size
nPos
=
m_aHeader
.
db_kopf
+
(
long
)(
m_nFilePos
-
1
)
*
m_aHeader
.
db_slng
;
...
@@ -2743,10 +2746,10 @@ bool ODbaseTable::ReadMemo(sal_Size nBlockNo, ORowSetValue& aVariable)
...
@@ -2743,10 +2746,10 @@ bool ODbaseTable::ReadMemo(sal_Size nBlockNo, ORowSetValue& aVariable)
return
true
;
return
true
;
}
}
void
ODbaseTable
::
AllocBuffer
()
bool
ODbaseTable
::
AllocBuffer
()
{
{
sal_uInt16
nSize
=
m_aHeader
.
db_slng
;
sal_uInt16
nSize
=
m_aHeader
.
db_slng
;
OSL_ENSURE
(
nSize
>
0
,
"Size too small"
);
SAL_WARN_IF
(
nSize
==
0
,
"connectivity.drivers"
,
"Size too small"
);
if
(
m_nBufferSize
!=
nSize
)
if
(
m_nBufferSize
!=
nSize
)
{
{
...
@@ -2760,6 +2763,8 @@ void ODbaseTable::AllocBuffer()
...
@@ -2760,6 +2763,8 @@ void ODbaseTable::AllocBuffer()
m_nBufferSize
=
nSize
;
m_nBufferSize
=
nSize
;
m_pBuffer
=
new
sal_uInt8
[
m_nBufferSize
+
1
];
m_pBuffer
=
new
sal_uInt8
[
m_nBufferSize
+
1
];
}
}
return
m_pBuffer
!=
NULL
;
}
}
bool
ODbaseTable
::
WriteBuffer
()
bool
ODbaseTable
::
WriteBuffer
()
...
...
connectivity/source/inc/dbase/DTable.hxx
Dosyayı görüntüle @
e46e041c
...
@@ -112,7 +112,7 @@ namespace connectivity
...
@@ -112,7 +112,7 @@ namespace connectivity
bool
WriteBuffer
();
bool
WriteBuffer
();
bool
UpdateBuffer
(
OValueRefVector
&
rRow
,
OValueRefRow
pOrgRow
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XIndexAccess
>&
_xCols
,
bool
bForceAllFields
);
bool
UpdateBuffer
(
OValueRefVector
&
rRow
,
OValueRefRow
pOrgRow
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XIndexAccess
>&
_xCols
,
bool
bForceAllFields
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
isUniqueByColumnName
(
sal_Int32
_nColumnPos
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
isUniqueByColumnName
(
sal_Int32
_nColumnPos
);
void
AllocBuffer
();
bool
AllocBuffer
();
void
throwInvalidDbaseFormat
();
void
throwInvalidDbaseFormat
();
void
SAL_CALL
renameImpl
(
const
OUString
&
newName
)
throw
(
::
com
::
sun
::
star
::
sdbc
::
SQLException
,
::
com
::
sun
::
star
::
container
::
ElementExistException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
renameImpl
(
const
OUString
&
newName
)
throw
(
::
com
::
sun
::
star
::
sdbc
::
SQLException
,
::
com
::
sun
::
star
::
container
::
ElementExistException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
sc/qa/unit/data/wks/fail/sf_8acee7303920116c1f58c9d0e669855f-7551-minimized.wks
0 → 100644
Dosyayı görüntüle @
e46e041c
File added
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