fix(model): reject null/empty YAML mapping keys in ParseBytes
ci / vet, staticcheck, test, build (push) Failing after 2m43s
ci / vet, staticcheck, test, build (push) Failing after 2m43s
A bare '?' in YAML is an explicit-key indicator for a null key, which produced a job with an empty name (p.Jobs[""]) — a parser invariant violation caught by FuzzParseBytes. ParseBytes now returns an error when keyNode.Value is empty. Failing corpus entry retained as a seed so CI exercises this path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,9 @@ func ParseBytes(data []byte) (*Pipeline, error) {
|
||||
keyNode := root.Content[i]
|
||||
valNode := root.Content[i+1]
|
||||
key := keyNode.Value
|
||||
if key == "" {
|
||||
return nil, fmt.Errorf("job name cannot be empty (null or missing YAML key)")
|
||||
}
|
||||
if ReservedKeys[key] {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user