From b957d7177d7bfa9e817a50a7de6d87c6601380e3 Mon Sep 17 00:00:00 2001 From: Rudo Thomas Date: Tue, 22 Apr 2025 18:29:06 +0200 Subject: [PATCH] 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 :1:31-42 object ... ``` --- builtins.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtins.go b/builtins.go index 421d5d34..6ecbd989 100644 --- a/builtins.go +++ b/builtins.go @@ -2264,7 +2264,9 @@ func builtinManifestYamlDoc(i *interpreter, arguments []value) (value, error) { } else { buf.WriteByte(' ') } - aux(fieldValue, buf, cindent) + if err := aux(fieldValue, buf, cindent); err != nil { + return err + } cindent = prevIndent } }