From 22cc80d562f8df04fb9e46ad758b5ca7de96bbdf Mon Sep 17 00:00:00 2001 From: CamrynCarter Date: Sun, 15 Mar 2026 12:31:28 -0700 Subject: [PATCH] validate numeric suffix on join --- pkg/archives/unarchiver.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/archives/unarchiver.go b/pkg/archives/unarchiver.go index 4a3d5ee..7678f26 100644 --- a/pkg/archives/unarchiver.go +++ b/pkg/archives/unarchiver.go @@ -197,8 +197,17 @@ func JoinChunks(ctx context.Context, archivePath, tempDir string) (string, error return archivePath, nil } - matches, err := filepath.Glob(base + "_*" + ext) - if err != nil || len(matches) == 0 { + all, err := filepath.Glob(base + "_*" + ext) + if err != nil { + return archivePath, nil + } + var matches []string + for _, m := range all { + if _, _, _, ok := chunkInfo(m); ok { + matches = append(matches, m) + } + } + if len(matches) == 0 { return archivePath, nil }