summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-06-11 12:57:31 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-06-12 16:30:18 +0200
commit3c453321813b538d575ce35f9e980dd7dad68679 (patch)
tree53be0387767b959aa49034d7043fbf61d2794e16
parent59e22664da0ee119d899c038a72d3de7f3d953b5 (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/38691 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Julien Nabet <serval2412@yahoo.fr>
-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 24715d9aad80..cd3ec9d2a750 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.