[Libreoffice-bugs] [Bug 143715] New: FILEOPEN DBF timestamp fields (type '@') trigger corruption error

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Aug 4 05:10:24 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=143715

            Bug ID: 143715
           Summary: FILEOPEN DBF timestamp fields (type '@') trigger
                    corruption error
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: dev at sheetjs.com

Description:
dBASE Level 7 DBF supports the timestamp field (type '@').  Valid DBF files
generated from dBASE are flagged as corrupt and LibreOffice fails to repair
them

Steps to Reproduce:
1. Download sample file
https://github.com/SheetJS/test_files/raw/master/dbf/d11.dbf
2. open in LibreOffice


Actual Results:
Error message "The file 'd11.dbf' is corrupt and therefore cannot be opened.
LibreOffice can try to repair the file."

Attempting to repair the file yields a new error message "The file 'd11.dbf'
could not be repaired and therefore cannot be opened."

Expected Results:
The file opens properly and the field is interpreted as Date


Reproducible: Always


User Profile Reset: Yes



Additional Info:
SheetJS currently uses the following algorithm to extract values.  The
algorithm agrees with dBASE 2019 on the values in the test file:

- Parse the 8 bytes of the field as an IEEE754 double in big-endian order
- Subtract 0x388317533400 (62135683200000, a number that can be exactly
represented in a IEEE754 double)
- Interpret the code as milliseconds since January 1 1970 (which is what JS
uses as the 0 value for the native Date object)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210804/8e1d2453/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list