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

[BUG] segfault on SHELL=bash #3606

Closed
mc-butler opened this issue Mar 12, 2016 · 5 comments
Closed

[BUG] segfault on SHELL=bash #3606

mc-butler opened this issue Mar 12, 2016 · 5 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.8.16 Reproducible in version 4.8.16
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3606
Reporter and

When using non-path SHELL variable like

$ SHELL=bash /usr/bin/mc

we will hit segfault at

==18747==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7ff92915602d bp 0x7ff92a327300 sp 0x7ffdcd67b698 T0)
    #0 0x7ff92915602c  (/lib64/libc.so.6+0x9e02c)
    #1 0x44d865 in __interceptor_strstr (/usr/bin/mc+0x44d865)
    #2 0x7ff92a233dd6 in mc_shell_recognize_and_fill_type /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/shell.c:151:52
    #3 0x7ff92a233dd6 in mc_shell_init /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/shell.c:233
    #4 0x4f7b92 in OS_Setup /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:128:5
    #5 0x4f7b92 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:250
    #6 0x7ff9290d88fb in __libc_start_main (/lib64/libc.so.6+0x208fb)
    #7 0x427148 in _start (/usr/bin/mc+0x427148)

root cause is not checking null case when filling mc_shell->real_path variable from mc_realpath()/realpath().

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 13, 2016 at 5:53 UTC (comment 1)

  • Status changed from new to accepted
  • Owner set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 13, 2016 at 7:50 UTC (comment 2)

  • Milestone changed from Future Releases to 4.8.17
  • Version changed from master to 4.8.16

Branch: 3606_shell_segfault
[c53e8d1afa67fbf4db74c6d1ddd3a185b42f0704]

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Mar 16, 2016 at 20:11 UTC (comment 3)

  • Branch state changed from no branch to approved
  • Votes set to zaytsev

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 17, 2016 at 6:27 UTC (comment 4)

  • Resolution set to fixed
  • Status changed from accepted to testing
  • Branch state changed from approved to merged
  • Votes changed from zaytsev to committed-master

Merged to master: [787cea2].

git log --pretty=oneline b678d3b..787cea2

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 17, 2016 at 6:28 UTC (comment 5)

  • Status changed from testing to closed

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 ver: 4.8.16 Reproducible in version 4.8.16
Development

No branches or pull requests

2 participants