From 55465c6e72a1ca0a1d7fc719ca73d18531e911fe Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 3 Jan 2026 18:59:18 +0900 Subject: internal/pkg: optionally validate flat pathnames This makes the decoder safe against untrusted input without hurting performance for a trusted stream. This should still not be called against untrusted input though. Signed-off-by: Ophestra --- internal/pkg/dir_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/pkg/dir_test.go') diff --git a/internal/pkg/dir_test.go b/internal/pkg/dir_test.go index 35fbbb38..97660279 100644 --- a/internal/pkg/dir_test.go +++ b/internal/pkg/dir_test.go @@ -85,7 +85,7 @@ func TestFlatten(t *testing.T) { t.Fatalf("Flatten: error = %v", err) } - s := pkg.NewDirScanner(bytes.NewReader(buf.Bytes())) + s := pkg.NewDirScanner(bytes.NewReader(buf.Bytes()), true) var got []pkg.FlatEntry for s.Scan() { got = append(got, *s.Entry()) -- cgit v1.3.1