summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-06-11 12:57:31 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2017-06-12 16:00:46 +0200
commitd2353a5a8afa5aa0a760b0e6412c2f77aa3a6df6 (patch)
tree5c0123b662473e459236b93d69886c198ec006f8
parente64a85d50dbd4db7a3de1ee2f6caf52cc60f6a50 (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>
-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.