superfile icon indicating copy to clipboard operation
superfile copied to clipboard

Recursive symlink crashes spf

Open anta40 opened this issue 1 year ago • 1 comments

To Reproduce

  1. Create a recursive symlink, e.g ln -s blahblah blahblah
  2. Run spf, keep navigating until you found the directory
  3. Then spf crashes...
panic: runtime error: invalid memory address or nil pointer dereference━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫1/3┣━┛┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
                                                                       [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x10d806d2a]

                                                                                                                                                 goroutine 125 [running
]:
  github.com/MHNightCat/superfile/internal.returnMetaData({{{0xc0000c8d88, 0x1, 0x1}, 0x8f, 0x0, 0x6}, {{0xc0001f8000, 0x7, 0x7}, 0x0}, ...})
                                                                                                                                                github.com/MHNightCat/s
uperfile/internal/function.go:288 +0x46a
                                        github.com/MHNightCat/superfile/internal.mainKey.func2()
                                                                                                        github.com/MHNightCat/superfile/internal/key_function.go:34 +0x
51
  created by github.com/MHNightCat/superfile/internal.mainKey in goroutine 1
                                                                                github.com/MHNightCat/superfile/internal/key_function.go:33 +0xa8a

Expected behavior spf doesn't crash, unless the user decides to enter that directory. mc (Midnight Commander) does it.

System information (please complete the following information):

  • macOS Monterey (x64) 12.7.4
  • Superfile Version 1.1.2 (installed via Homebrew)

anta40 avatar May 10 '24 16:05 anta40

@anta40 Hey, thanks for the report, I just fixed it: https://github.com/MHNightCat/superfile/commit/6235c1dfc809967b21be945ad42915b40e8a0fa5

yorukot avatar May 10 '24 16:05 yorukot