Ticket #1942: MC crashes on exit when using C locale.4.7.0-stable
commit43bb84d66d9d04da93e48c98057e6b781fbef878
authorMilan Cermak <milan.cermak@sun.com>
Wed, 6 Jan 2010 15:33:42 +0000 (6 18:33 +0300)
committerSlava Zanko <slavazanko@gmail.com>
Wed, 6 Jan 2010 21:05:15 +0000 (6 23:05 +0200)
treec869e2c120e9f73db856460a76ae10968548d873
parent822a7fa62470a27745b53bf15b50853299f25a75
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>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
src/strutil.c