matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Potential panic on empty EDITOR environment variable

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

In the external editor launch code (main.go:2376), strings.Fields(editor) is called on the EDITOR env var. If EDITOR is set to whitespace-only (e.g. EDITOR=" "), strings.Fields returns an empty slice. Accessing parts[0] then causes a panic (index out of range).

To reproduce

  1. Set EDITOR=" "
  2. Trigger external editor in composer
  3. Observe panic: index out of range

Expected behavior

Check len(parts) > 0 before accessing parts[0], return an error if empty.

andrinoff avatar Apr 24 '26 20:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 26 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 09 '26 06:06 floatpanebot