From 4dbdf586887614a334b2af47d6a83f3a5d0ea516 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Tue, 5 Apr 2022 23:59:33 +0200 Subject: 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 Acked-by: Robin Jarry --- commands/compose/header.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commands') 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 ) -- cgit