Skip to content

Commit 80c7c4a

Browse files
rudo-thomasjohnbartholomew
authored andcommitted
fix: Unchecked error in std.manifestYamlDoc().
Problem: A recursive call within manifestYamlDoc() might fail but the return value is not checked. Reproducible with: ``` $ jsonnet-2f73f61 -e "std.manifestYamlDoc({ x: { y: error 'foo' } }, quote_keys=false)" "x:\n " ``` Expected: ``` $ jsonnet-0.20.0 -e "std.manifestYamlDoc({ x: { y: error 'foo' } }, quote_keys=false)" RUNTIME ERROR: foo <cmdline>:1:31-42 object <anonymous> ... ```
1 parent bfa7272 commit 80c7c4a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtins.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,9 @@ func builtinManifestYamlDoc(i *interpreter, arguments []value) (value, error) {
22642264
} else {
22652265
buf.WriteByte(' ')
22662266
}
2267-
aux(fieldValue, buf, cindent)
2267+
if err := aux(fieldValue, buf, cindent); err != nil {
2268+
return err
2269+
}
22682270
cindent = prevIndent
22692271
}
22702272
}

0 commit comments

Comments
 (0)