Skip to content

test: Check manifest.Platform before dereferencing#3438

Merged
estesp merged 1 commit intocontainerd:masterfrom
darfux:test_check_manifest_platform_nil
Jul 22, 2019
Merged

test: Check manifest.Platform before dereferencing#3438
estesp merged 1 commit intocontainerd:masterfrom
darfux:test_check_manifest_platform_nil

Conversation

@darfux
Copy link
Copy Markdown
Contributor

@darfux darfux commented Jul 22, 2019

If the registry returns a manifest without platform info, the
manifest.Platform will be nil and cause panic when dereferencing. Such as:

=== RUN   TestImagePullSomePlatforms
--- FAIL: TestImagePullSomePlatforms (0.02s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1371cf3]

Signed-off-by: Li Yuxuan [email protected]

If the registry returns a manifest without platform info, the
`manifest.Platform` will be `nil` and cause panic when dereferencing.

Signed-off-by: Li Yuxuan <[email protected]>
@darfux darfux force-pushed the test_check_manifest_platform_nil branch from 74957bc to 5e5ae23 Compare July 22, 2019 12:47
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jul 22, 2019

Build succeeded.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 22, 2019

Codecov Report

Merging #3438 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3438   +/-   ##
=======================================
  Coverage   44.32%   44.32%           
=======================================
  Files         123      123           
  Lines       13693    13693           
=======================================
  Hits         6070     6070           
  Misses       6692     6692           
  Partials      931      931
Flag Coverage Δ
#linux 48.13% <ø> (ø) ⬆️
#windows 39.89% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f58fda9...5e5ae23. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

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 e14cc99 into containerd:master Jul 22, 2019
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.

4 participants