chore: revert custom index in favor of key_Split

Signed-off-by: Keith Zantow <keith.zantow@anchore.com>
This commit is contained in:
Keith Zantow
2026-09-20 11:22:10 -04:00
parent 99615b7dfa
commit 53cd4254e4
81 changed files with 7461 additions and 6624 deletions
-39
View File
@@ -305,45 +305,6 @@ func TestSafeJoin(t *testing.T) {
expected: "",
errAssertion: assertErrorAs(&errZipSlipDetected{}),
},
// a legitimate nested path, several components deep
{
prefix: "/a/place",
args: []string{
"lib",
"sub",
"file.txt",
},
expected: "/a/place/lib/sub/file.txt",
errAssertion: assert.NoError,
},
// the prefix itself is inside the prefix
{
prefix: "/a/place",
args: []string{
".",
},
expected: "/a/place",
errAssertion: assert.NoError,
},
// siblings that share the prefix as a STRING are not inside it. A string-prefix comparison
// accepted these, so an archive entry could write into a directory next to the one it was
// being extracted into.
{
prefix: "/a/place",
args: []string{
"../place-evil/x",
},
expected: "",
errAssertion: assertErrorAs(&errZipSlipDetected{}),
},
{
prefix: "/tmp/syft-archive-abc/contents",
args: []string{
"../contents-evil/x",
},
expected: "",
errAssertion: assertErrorAs(&errZipSlipDetected{}),
},
}
for _, test := range tests {