Bug 61076 - UI User dictionary name is not validated
Summary: UI User dictionary name is not validated
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
3.6.4.3 release
Hardware: Other All
: high major
Assignee: Ritchie Cunningham
URL:
Whiteboard: target:6.4.0
Keywords:
Depends on:
Blocks: Options-Dialog-Language
  Show dependency treegraph
 
Reported: 2013-02-18 18:06 UTC by Urmas
Modified: 2019-08-07 06:18 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Urmas 2013-02-18 18:06:41 UTC
Currently the dictionary names are not validated, and user can create a dictionary with characters like / in their names. Such dictionary is not saved into file, but it can be used, despite being irrecoverably lost after Writer terminates.
Comment 1 Joel Madero 2013-02-19 03:04:00 UTC
Indeed. Reproducible steps:

1. Open a new writer document
2. Type some nonsense words
3. F7 for spelling and grammar
4. Go to Options
5. New...
6. Make a new dictionary that begins with /
7. Click Ok

Results: 
Dictionary appears to work in current sheet but then is lost as Urmas states because of illegal use of character

Expected:
LibreOffice should provide error and demand different name

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Changing version to reflect oldest tested version: 
3.6.4.3
Bodhi Linux

Marking as:
New (confirmed)
Major (loss of data, no error)
High (default, no need to change)

Thanks Urmas for the report
Comment 2 Urmas 2013-02-19 07:18:25 UTC
Code pointer:

core/cui/source/options/optdict.cxx:119
Comment 3 QA Administrators 2015-02-19 15:37:54 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2015-03-07 13:39:02 UTC
Reproduced.

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI
Comment 5 tommy27 2016-04-16 07:22:49 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2017-05-22 13:22:13 UTC Comment hidden (obsolete)
Comment 7 Thomas Lendo 2018-11-04 01:55:46 UTC
Still reproducible with Version: 6.2.0.0.alpha1+
Build ID: 612a107464c1889fdc4806a3c86da8c2fbf452c8
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: de-DE (de_DE.UTF-8); Calc: threaded
Comment 8 Ritchie Cunningham 2019-04-22 01:45:39 UTC
Submitted patch for this bug: https://gerrit.libreoffice.org/#/c/71059/

Joel Madero, I hope you don't mind that I added you as a reviewer, I'm still not sure on the etiquette for setting reviewers.

In the process of fixing this, I found that you can also set a dictionary with no name. The 'OK' button should be inactive when nothing has been entered into the input field.
Comment 9 Buovjaga 2019-04-22 07:47:31 UTC
(In reply to Ritchie Cunningham from comment #8)
> Submitted patch for this bug: https://gerrit.libreoffice.org/#/c/71059/
> 
> Joel Madero, I hope you don't mind that I added you as a reviewer, I'm still
> not sure on the etiquette for setting reviewers.
> 
> In the process of fixing this, I found that you can also set a dictionary
> with no name. The 'OK' button should be inactive when nothing has been
> entered into the input field.

Joel's role in this report was just to confirm it as a QA team member.

I can test the patch later myself.
Comment 10 Buovjaga 2019-04-24 11:36:26 UTC
I built with the patch and confirm that it now prevents us from starting a dictionary name with /
Comment 11 Ritchie Cunningham 2019-04-24 11:43:46 UTC
(In reply to Buovjaga from comment #10)
> I built with the patch and confirm that it now prevents us from starting a
> dictionary name with /

Thank you. It prevents both '\' and '/' As they both cause data loss. It will also prevent a name like 'new/dict.dic' as this would trim the name to 'dict.dic'
Comment 12 Xisco Faulí 2019-08-06 14:31:26 UTC
Patch restored in gerrit
Comment 13 Commit Notification 2019-08-07 06:07:39 UTC
Rtch90 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/c78306fb47011a3c050368b9696cb2d5ecf3d57d%5E%21

tdf#61076 string validation on creation of new dictionary.

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.