Skip to content

validate: fix spec.Hooks nil dereference - #361

Merged
Mashimiao merged 1 commit into
opencontainers:masterfrom
cyphar:hook-nil-deref
Apr 12, 2017
Merged

validate: fix spec.Hooks nil dereference#361
Mashimiao merged 1 commit into
opencontainers:masterfrom
cyphar:hook-nil-deref

Conversation

@cyphar

@cyphar cyphar commented Apr 11, 2017

Copy link
Copy Markdown
Member

Fixes the following issue:

  panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4ce0c9]

  goroutine 1 [running]:
  panic(0x5ad320, 0xc4200120a0)
  	/usr/lib64/go/src/runtime/panic.go:500 +0x1a1
  github.com/opencontainers/runtime-tools/validate.(*Validator).CheckHooks(0xc4200b77b8, 0xc420084d80, 0x0, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/validate/validate.go:203 +0x89
  github.com/opencontainers/runtime-tools/validate.(*Validator).CheckAll(0xc4200b77b8, 0x26, 0x0, 0xc4200aa000)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/validate/validate.go:109 +0x582
  main.glob..func2(0xc4200a2140, 0x0, 0x20000c4200a2140)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/cmd/oci-runtime-tool/validate.go:28 +0x107
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.HandleAction(0x5a51a0, 0x5f7620, 0xc4200a2140, 0xc42005a300, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/app.go:485 +0xd4
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.Command.Run(0x5dcbc9, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5e0f3c, 0x16, 0x0, ...)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/command.go:193 +0xb96
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.(*App).Run(0xc420064d00, 0xc4200601b0, 0x3, 0x3, 0x0, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/app.go:250 +0x812
  main.main()
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/cmd/oci-runtime-tool/main.go:32 +0x2fe

Signed-off-by: Aleksa Sarai asarai@suse.de

Fixes the following issue:

  panic: runtime error: invalid memory address or nil pointer dereference
  [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4ce0c9]

  goroutine 1 [running]:
  panic(0x5ad320, 0xc4200120a0)
  	/usr/lib64/go/src/runtime/panic.go:500 +0x1a1
  github.com/opencontainers/runtime-tools/validate.(*Validator).CheckHooks(0xc4200b77b8, 0xc420084d80, 0x0, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/validate/validate.go:203 +0x89
  github.com/opencontainers/runtime-tools/validate.(*Validator).CheckAll(0xc4200b77b8, 0x26, 0x0, 0xc4200aa000)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/validate/validate.go:109 +0x582
  main.glob..func2(0xc4200a2140, 0x0, 0x20000c4200a2140)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/cmd/oci-runtime-tool/validate.go:28 +0x107
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.HandleAction(0x5a51a0, 0x5f7620, 0xc4200a2140, 0xc42005a300, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/app.go:485 +0xd4
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.Command.Run(0x5dcbc9, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5e0f3c, 0x16, 0x0, ...)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/command.go:193 +0xb96
  github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli.(*App).Run(0xc420064d00, 0xc4200601b0, 0x3, 0x3, 0x0, 0x0)
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/vendor/github.com/urfave/cli/app.go:250 +0x812
  main.main()
  	/home/abuild/rpmbuild/BUILD/go/src/github.com/opencontainers/runtime-tools/cmd/oci-runtime-tool/main.go:32 +0x2fe

Signed-off-by: Aleksa Sarai <asarai@suse.de>
@mrunalp

mrunalp commented Apr 11, 2017

Copy link
Copy Markdown
Contributor

LGTM

Approved with PullApprove

1 similar comment
@Mashimiao

Mashimiao commented Apr 12, 2017

Copy link
Copy Markdown

LGTM

Approved with PullApprove

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