To reproduce :
1. Create a zero sized file, as myfile.html or myfile.odt or other.
2. Open it in Libreoffice.
3. The file is displayed with garbage bytes. Without saving it, the file on the disk is modified !!
4. The Debian file command says after that :
$ file myfile.html
Composite Document File V2 Document, No summary info.
Openoffice 4 has the same bug despite of an alert dialog box with a choice.
This bug should be considered as a security hole because it modifies unexpectedly a file. This file could have a role in the system as .gksu.lock or others.
All software must not modified involuntary an user file.
On Debian Wheezy 7.5.
Not reproducible for me with LibreOffice 184.108.40.206.0+ under Ubuntu 14.04 x86-64.
I created an empty file named new_test.odt. The file opened by LibreOffice is displayed empty and not changed when I close it without saving it (it is still O sized). Same behavior with a file named with html extension.
Best regards. JBF
Actually I fixed it for 4.3/master, but didn't backport to 4-2.
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":
fdo#81284 Don't write to zero length files
It will be available in LibreOffice 4.2.7.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
(In reply to comment #3)
This patch seems to fix the bug for me (4.2.7 beta).
Thank you very much.