summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-06-11 12:57:31 +0200
committerAndras Timar <andras.timar@collabora.com>2017-06-13 12:22:08 +0200
commit3742b583af95aa08b17116fce35471081e925dfe (patch)
treee90ef6cbd338fab114d0069304d416f9981eb815 /sc
parent2f1fe6fb70ed7f71cd9e1cd12c35dca13eccc178 (diff)
tdf#106423: dbase file can have no records
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=4e3ff19b33c84557fd20e68960499933b4e52638 tdf#84834 sc: stricter type detection for dBASE files Log test file from tdf#84834 still opens in Writer as expected Change-Id: Ibf5a0f586e3a132455d2363e61e5cc7ea249002d Reviewed-on: https://gerrit.libreoffice.org/38660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 57ae8834c8313354477117b65d87c86407f6bf82) Reviewed-on: https://gerrit.libreoffice.org/38692 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> (cherry picked from commit d2353a5a8afa5aa0a760b0e6412c2f77aa3a6df6)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 6e3318bdddc8..841191816e45 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -241,7 +241,8 @@ static bool lcl_MayBeDBase( SvStream& rStream )
}
// tdf#84834 sanity check of size
- if (0 == nRecords || nSize < nHeaderLen + nRecords * sal_uInt64(nRecordSize))
+ // tdf#106423: a dbf file can have 0 record, so no need to check nRecords
+ if (nSize < nHeaderLen + nRecords * sal_uInt64(nRecordSize))
return false;
// Last byte of header must be 0x0d, this is how it's specified.