From 52c395eb643fe17b8070a870063e5d6f36f08d3e Mon Sep 17 00:00:00 2001 From: TerrySolar <531012201@qq.com> Date: Tue, 22 Oct 2019 01:40:37 +0800 Subject: [PATCH] fix panic when config value set 0 (#1723) --- pkg/terminal/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/terminal/config.go b/pkg/terminal/config.go index fc1f8346..ff200c9b 100644 --- a/pkg/terminal/config.go +++ b/pkg/terminal/config.go @@ -123,6 +123,9 @@ func configureSet(t *Term, args string) error { if err != nil { return reflect.ValueOf(nil), fmt.Errorf("argument to %q must be a number", cfgname) } + if n < 0 { + return reflect.ValueOf(nil), fmt.Errorf("argument to %q must be a number greater than zero", cfgname) + } return reflect.ValueOf(&n), nil case reflect.Bool: v := rest == "true"