diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-04-05 23:59:33 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-04-06 15:37:13 +0200 |
commit | 4dbdf586887614a334b2af47d6a83f3a5d0ea516 (patch) | |
tree | ab8e5a59cb8d74d2bdbc7b65fc1214f10b946e27 /commands | |
parent | 3c08b8e6a903aec409871aee38002173c73109ee (diff) | |
download | aerc-4dbdf586887614a334b2af47d6a83f3a5d0ea516.tar.gz |
fix: out-of-bounds error in command header
This commit fixes an out-of-bound error that happened while parsing
commands.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/compose/header.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/compose/header.go b/commands/compose/header.go index 59b1caac..fc0a81b2 100644 --- a/commands/compose/header.go +++ b/commands/compose/header.go @@ -1,6 +1,7 @@ package compose import ( + "errors" "fmt" "strings" @@ -44,6 +45,11 @@ func (Header) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return err } + + if len(args) < optind+1 { + return errors.New("command parsing failed") + } + var ( force bool = false ) |