Skip to content

[release/1.4] Fix panic in metadata content writer on copy error#6044

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

[release/1.4] Fix panic in metadata content writer on copy error#6044
fuweid merged 1 commit intocontainerd:release/1.4from
dmcgowan:1.4-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]>
@dmcgowan dmcgowan changed the title Fix panic in metadata content writer on copy error [release/1.4] Fix panic in metadata content writer on copy error Sep 23, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Sep 23, 2021

Build succeeded.

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

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 9b712ec into containerd:release/1.4 Sep 24, 2021
@dmcgowan dmcgowan deleted the 1.4-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