summaryrefslogtreecommitdiff
path: root/internal/command/twofactorrecover/twofactorrecover.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/command/twofactorrecover/twofactorrecover.go')
-rw-r--r--internal/command/twofactorrecover/twofactorrecover.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/command/twofactorrecover/twofactorrecover.go b/internal/command/twofactorrecover/twofactorrecover.go
index f0a9e7b..f5a700a 100644
--- a/internal/command/twofactorrecover/twofactorrecover.go
+++ b/internal/command/twofactorrecover/twofactorrecover.go
@@ -3,6 +3,7 @@ package twofactorrecover
import (
"context"
"fmt"
+ "io"
"strings"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
@@ -11,6 +12,8 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/twofactorrecover"
)
+const readerLimit = 1024
+
type Command struct {
Config *config.Config
Args *commandargs.Shell
@@ -34,7 +37,7 @@ func (c *Command) canContinue() bool {
fmt.Fprintln(c.ReadWriter.Out, question)
var answer string
- fmt.Fscanln(c.ReadWriter.In, &answer)
+ fmt.Fscanln(io.LimitReader(c.ReadWriter.In, readerLimit), &answer)
return answer == "yes"
}