diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-26 14:05:37 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-17 10:30:38 +0100 |
commit | b284fa693da7f4dc9120d5b398917622847a904d (patch) | |
tree | ad8904fb8eb843db9c4efa5ebc5c38530cdffb38 /connectivity | |
parent | ofz#39301 month has to be in range [1-12] (diff) | |
download | core-b284fa693da7f4dc9120d5b398917622847a904d.tar.gz core-b284fa693da7f4dc9120d5b398917622847a904d.zip |
ofz#39304 short timestamp record
Change-Id: I8f783473dd5d4679846c7c866cd1853ef7d919fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122628
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit bfc70a9f314bbb5b03247be25544e9b4cc467f8d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125331
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index ffd4eb2ab30f..6bd9ce2bbaf1 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -773,10 +773,8 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool for (std::size_t i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i < nCount;++aIter, i++) { // Lengths depending on data type: - sal_Int32 nLen = 0; - sal_Int32 nType = 0; - nLen = m_aPrecisions[i-1]; - nType = m_aTypes[i-1]; + sal_Int32 nLen = m_aPrecisions[i-1]; + sal_Int32 nType = m_aTypes[i-1]; switch(nType) { @@ -835,8 +833,13 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool else if ( DataType::TIMESTAMP == nType ) { sal_Int32 nDate = 0,nTime = 0; + if (nLen < 8) + { + SAL_WARN("connectivity.drivers", "short TIMESTAMP"); + return false; + } memcpy(&nDate, pData, 4); - memcpy(&nTime, pData+ 4, 4); + memcpy(&nTime, pData + 4, 4); if ( !nDate && !nTime ) { (_rRow->get())[i]->setNull(); |