diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe7811..7ea4147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,11 +13,13 @@ - Delete the inside flag due to duplicate - Add `.dockerconfigjson` in secret checking - Add Docker Histories environment checking - -## improvements - Add the date of kernel compiling checking in checking of kernel version - Add the error output in image saving +## fixed +- Fix the out of range in container extract + + # 1.0.8 (2023.6.6) ## features - Add dangerous image used checking in Docker diff --git a/internal/extract.go b/internal/extract.go index 9d550bc..5973661 100644 --- a/internal/extract.go +++ b/internal/extract.go @@ -63,12 +63,14 @@ func Extract(ctx context.Context, tarPath string, tarIO []io.ReadCloser) (*layer } // Get mount path - for _, mio := range tarIO[1:] { - tarReader = tar.NewReader(mio) - err = pkg.Walk(tarReader, tempPath) - if err != nil { - log.Printf("decompress mount path failed, error: %v", err) - continue + if len(tarIO) > 1 { + for _, mio := range tarIO[1:] { + tarReader = tar.NewReader(mio) + err = pkg.Walk(tarReader, tempPath) + if err != nil { + log.Printf("decompress mount path failed, error: %v", err) + continue + } } }