Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

length check for parameters

Michael Yang40d0c4a1dc18
diff --git a/parser/parser.go b/parser/parser.go
index 06ccf7867..0edba562c 100644
--- a/parser/parser.go
+++ b/parser/parser.go
@@ -45,6 +45,10 @@ func Parse(reader io.Reader) ([]Command, error) {
command.Args = string(fields[1])
case "PARAMETER":
fields = bytes.SplitN(fields[1], []byte(" "), 2)
+ if len(fields) < 2 {
+ return nil, fmt.Errorf("missing value for %s", fields)
+ }
+
command.Name = string(fields[0])
command.Args = string(fields[1])
default: