Home GnuPG

Fix crash on filename conversion error

Description

Fix crash on filename conversion error

* src/fileman.c (add_file): Handle conversion errors.

If g_filename_to_utf8 fails we now fall back to g_locale_to_utf8.
If this still does not work we fall back to g_filename_display_name
which replaces unconvertibale strings by question marks or unicode
markup.
Previously NULL pointer would be inserted as filenames, leading
to crashes later on.

This is especially important for windows where D&D files came
in System encoding as well as "Double clicked" or "Open With" files.
On windows filename_to_utf8 always assumes that the input is already
UTF-8, because it's stupid. (or because the GTK File Dialog returns
UTF-8 filenames) so the fallback to locale is especially important
here.

Details

Provenance
aheineckeAuthored on May 14 2017, 2:39 PM
Parents
rGPA2dae64a65080: w32: Make location of locale dir more flexible
Branches
Unknown
Tags
Unknown
Tasks
T2185: Gpa crash when opening a non ASCII file with gpa