Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error handling for iconv conversions in VFS and editor code #4591

Open
mc-butler opened this issue Sep 24, 2024 · 0 comments
Open

Add error handling for iconv conversions in VFS and editor code #4591

mc-butler opened this issue Sep 24, 2024 · 0 comments
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4591
Reporter zaytsev (@zyv)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant