Ticket #4591 (new defect)
Opened 3 months ago
Add error handling for iconv conversions in VFS and editor code
Reported by: | zaytsev | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future Releases |
Component: | mc-core | Version: | master |
Keywords: | Cc: | ||
Blocked By: | #3972 | Blocking: | |
Branch state: | no branch | Votes for changeset: |
Description
This is a follow-up to #3972.
Fixing a test suite on Illumos exposed missing error handling around charset conversions. This results in segfaults or silent incorrect behaviour if encodings are not set up correctly or converters cannot be created.
The edit_complete_word_cmd test fails when switched to UTF-8, which it shouldn't. Some VFS tests only work in UTF-8, not because they should, but because unhandled conversion results cause encodings to disappear from the path.
str_vfs_convert_from
- lib\vfs\interface.c:482 - mc_readdir
- lib\vfs\path.c:699 - vfs_path_to_str_flags
- src\filemanager\panel.c:5018 - remove_encoding_from_path
_vfs_translate_path
Returns a NULL pointer, and only on hard errors. Propagating NULL pointers are not checked everywhere.
- lib\vfs\vfs.c:372 - vfs_translate_path
str_crt_conv_to / str_crt_conv_from
The usages should be audited, dir.converter might not be always handled correctly.
str_convert / str_nconvert
- src\args.c:437 - mc_args__convert_help_to_syscharset (str_convert)
For str_nconvert no checks are performed.