Bug 130308 - [FILEOPEN] file with wrong(?) extension .dot doesn't open - gives error "Read Error - This is not a valid WinWord6 File"
Summary: [FILEOPEN] file with wrong(?) extension .dot doesn't open - gives error "Read...
Status: RESOLVED DUPLICATE of bug 125216
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-01-31 09:06 UTC by Cor Nouws
Modified: 2020-02-01 09:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
dot file resaved (44.50 KB, application/msword)
2020-01-31 15:48 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2020-01-31 09:06:39 UTC
There is a (Dutch parliament) document linked on this page

https://www.tweedekamer.nl/kamerstukken/amendementen/detail?id=2020Z01578&did=2020D03316 
Downloads as Amendement_van_het_lid_Verhoeven_34972-23_over_de_erkenning_langs_de_kamers_voor_verlening.dot

Try to open in ~master > error
Try to open in 6.0.7.2 > Opens fine
Rename to .doc > opens in master.
Comment 1 Julien Nabet 2020-01-31 10:48:56 UTC
On Win10 with master sources updated today, I could reproduce this.
Comment 2 Julien Nabet 2020-01-31 11:00:10 UTC
Regression from:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=65559252f138aada7a55d3c5fe0a932a222d13e0
tdf#110987: Don't mis-detect .doc files as .dot
Also add a unit test for that.

Change-Id: I86c195cebbe12b2bdf498954956db882f6f0d12b
Reviewed-on: https://gerrit.libreoffice.org/68005
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>

Indeed, reverting this patch makes LO able to open dot file.

Tor: one for you?
Comment 3 How can I remove my account? 2020-01-31 11:38:47 UTC
Now we just have to chose which misbehaviour is the best one. I know, let's switch back and forth in each major version! (Joke.) Or let's pop up a dialog asking the user! (Also a joke.)

Seriously: No, I don't want to touch this any more. Anybody is free to revert my change, of course. Why would I care.
Comment 4 How can I remove my account? 2020-01-31 11:39:14 UTC
s/chose/choose
Comment 5 Julien Nabet 2020-01-31 13:24:58 UTC
Tor: just to be sure my previous comment was misinterpreted, when I told regression from ...,
I didn't mean : "you made the commit, you're the culprit, you must fix this".
I just meant this patch triggered this regression but perhaps the patch revealed another cornercase bug in addition with fixing tdf#110987 and maybe you may have some idea since you had worked on it. Of course, don't hesitate to uncc yourself.

About the bug itself, I'm giving a look at https://interoperability.blob.core.windows.net/files/MS-DOC/%5bMS-DOC%5d-190319.pdf, trying to understand how FibBase is built.
Comment 6 Julien Nabet 2020-01-31 15:44:08 UTC
Cor: just for the test, I opened the file on Word 365 and saved it (without any changed on a new file).

Here's hexdump of extract FibBase struct(see my previous comment) before:
EC A5 C1 00 63 00 13 04 00 00 F0

Here's hexdump of extract FibBase struct after:
EC A5 C1 00 6F 00 09 04 00 00 F1

"F1" = 11110001
So "fDot" (the bit tested in Tor's patch) = 1, here (contrary to the initial doc) and the new dot file can be opened on LO.

I think I already read something about MsOffice file validation but not sure. The idea would be to validate dot file provided by the website.
Comment 7 Julien Nabet 2020-01-31 15:48:08 UTC
Created attachment 157564 [details]
dot file resaved

Here's the dot file resaved which is correctly opened on LO.
Comment 8 Aron Budea 2020-02-01 09:51:36 UTC
This is the same as bug 125216 if I'm not mistaken.

*** This bug has been marked as a duplicate of bug 125216 ***