aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/dir_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-03 18:59:18 +0900
committerOphestra <cat@gensokyo.uk>2026-01-03 18:59:18 +0900
commit55465c6e72a1ca0a1d7fc719ca73d18531e911fe (patch)
treecb7f42b12658738935244ff9cab4febbf0b8703f /internal/pkg/dir_test.go
parentce249d23f1e3d3d90330fd8d02699b4b7c8ccb9b (diff)
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/dir_test.go')
-rw-r--r--internal/pkg/dir_test.go2
1 files changed, 1 insertions, 1 deletions
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())