Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy: fix nil pointer dereference when checking compression algorithm #2120

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

crazy-max
Copy link
Contributor

related to #2047

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xcbbbf7]

goroutine 1 [running]:
github.com/containers/image/v5/copy.(*imageCopier).compareImageDestinationManifestEqual(0xc0000c3860, {0x1b88850, 0xc000044158}, 0xc00001cc08)
        /home/crazymax/github.com/containers/image/[email protected]/copy/single.go:384 +0x677
github.com/containers/image/v5/copy.(*copier).copySingleImage(0xc000427b80, {0x1b88850, 0xc000044158}, 0xc00048dc80, 0xc00001cc08, {0x4?, 0x0?, 0x0?})
        /home/crazymax/github.com/containers/image/[email protected]/copy/single.go:194 +0xde5
github.com/containers/image/v5/copy.(*copier).copyMultipleImages(0xc000427b80, {0x1b88850, 0xc000044158})
        /home/crazymax/github.com/containers/image/[email protected]/copy/multiple.go:242 +0x1149
github.com/containers/image/v5/copy.Image({0x1b88850, 0xc000044158}, 0xc0005670f8, {0x1b8e7e0, 0xc0002a8c60}, {0x1b8e660?, 0xc00071e840?}, 0x0?)
        /home/crazymax/github.com/containers/image/[email protected]/copy/copy.go:337 +0x1485

cc @flouthoc @mtrmac

Copy link
Contributor

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this. I am just wondering what is the MIME type in your case ? looks some unexpected MIME type ( anyways nil should be handled so thanks for fixing this )

@crazy-max
Copy link
Contributor Author

crazy-max commented Sep 16, 2023

Thanks for fixing this. I am just wondering what is the MIME type in your case ? looks some unexpected MIME type ( anyways nil should be handled so thanks for fixing this )

It was for a layer part of an attestation manifest dockereng/packaging:docker-engine-v24.0.4: https://explore.ggcr.dev/?image=dockereng/packaging@sha256:1e06504de44779bb34895d780f1705c8e156255ec477042146555cf32d98034f&mt=application%2Fvnd.oci.image.manifest.v1%2Bjson&size=566

@crazy-max
Copy link
Contributor Author

You can create such manifest with BuildKit: https://docs.docker.com/build/attestations/attestation-storage/

@flouthoc
Copy link
Contributor

@crazy-max Thanks for sharing this.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@mtrmac mtrmac merged commit 27b3a7e into containers:main Sep 18, 2023
9 checks passed
@crazy-max crazy-max deleted the fix-nil-deref branch September 18, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants