Skip to content

[release/1.5] Fix panic in metadata content writer on copy error#6045

Merged
estesp merged 1 commit intocontainerd:release/1.5from
dmcgowan:1.5-fix-metadata-content-panic
Sep 24, 2021
Merged

[release/1.5] Fix panic in metadata content writer on copy error#6045
estesp merged 1 commit intocontainerd:release/1.5from
dmcgowan:1.5-fix-metadata-content-panic

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

The createAndCopy function is only called when nw.w is nil
in order to create a new writer and prepare it. The current code
is attempting to close nw.w when there is a copy error. The
correct behavior would be to close the new writer and not touch nw.w.

Signed-off-by: Derek McGowan [email protected]
(cherry picked from commit b9cf0d7)
Signed-off-by: Derek McGowan [email protected]

The `createAndCopy` function is only called when `nw.w` is nil
in order to create a new writer and prepare it. The current code
is attempting to close `nw.w` when there is a copy error. The
correct behavior would be to close the new writer and not touch `nw.w`.

Signed-off-by: Derek McGowan <[email protected]>
(cherry picked from commit b9cf0d7)
Signed-off-by: Derek McGowan <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Sep 23, 2021

Build succeeded.

Copy link
Copy Markdown
Contributor

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 0631957 into containerd:release/1.5 Sep 24, 2021
@thaJeztah
Copy link
Copy Markdown
Member

backport of #6043

@dmcgowan dmcgowan deleted the 1.5-fix-metadata-content-panic branch March 23, 2022 22:22
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.

5 participants