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>
This commit is contained in:
Moritz Poldrack 2022-04-05 23:59:33 +02:00 committed by Robin Jarry
parent 3c08b8e6a9
commit 4dbdf58688
1 changed files with 6 additions and 0 deletions

View File

@ -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
)