Ticket #1942: MC crashes on exit when using C locale.
commitd80f098c119eca68462410d7b8e66ccd25a827f5
authorMilan Cermak <milan.cermak@sun.com>
Wed, 6 Jan 2010 15:33:42 +0000 (6 18:33 +0300)
committerAndrew Borodin <aborodin@vmail.ru>
Wed, 6 Jan 2010 15:46:09 +0000 (6 18:46 +0300)
tree4851285efbf7391597d9167c5bcc1a193df6f2be
parent07f3009b7109beec965e3899f33c4f20203783f3
Ticket #1942: MC crashes on exit when using C locale.

Starting mc with:
LANG=C mc
cases a crash when mc exits. No other LC_* variable was set.

The issue is in src/strutil.c module. With C locale, str_init_strings()
fails to set str_cnv_not_convert variable leaving it with value -1
(INVALID_CONV). str_uninit_strings() passes str_cnv_not_convert blindly
to g_iconv_close() which tries to dereference it.

This commit adds a check to str_uninit_strings() if str_cnv_not_convert
value is valid.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/strutil.c