Ticket #1942 (closed defect: fixed)

Opened 10 years ago

Last modified 9 years ago

mc crashes on exit when using C locale

Reported by: mcermak Owned by: andrew_b
Priority: major Milestone: 4.7.1
Component: mc-core Version: 4.7.0.1
Keywords: crash Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

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.
Attached patch adds a check to str_uninit_strings() if str_cnv_not_convert value is valid.

Attachments

10_locale_c_iconv.patch (398 bytes) - added by mcermak 10 years ago.
Fix for invalid pointer dereference in str_uninit_strings()

Change History

Changed 10 years ago by mcermak

Fix for invalid pointer dereference in str_uninit_strings()

comment:1 Changed 10 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Votes for changeset set to andrew_b
  • severity changed from no branch to on review

Created 1942_crash_on_exit branch. Parent branch is master.
changeset:962394e57bc878542b26772bce7ed2e3856c1e93

comment:2 Changed 10 years ago by andrew_b

  • Milestone changed from 4.7 to 4.7.1

comment:3 Changed 10 years ago by angel_il

  • Votes for changeset changed from andrew_b to andrew_b angel_il
  • severity changed from on review to approved

comment:4 Changed 10 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b angel_il to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:5 Changed 10 years ago by andrew_b

  • Status changed from testing to closed

comment:6 Changed 10 years ago by slavazanko

cherry-picked into 4.7.0-stable: 43bb84d66d9d04da93e48c98057e6b781fbef878

Note: See TracTickets for help on using tickets.