diff options
author | ShiruRen <renshiru2000@gmail.com> | 2019-01-25 15:01:55 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-25 15:03:17 -0800 |
commit | c6facd0358ae61849786dbbc0f4f5a07a25cb6f1 (patch) | |
tree | 0c6022630e003969aa31b3f35f591f5078afcdfd /runsc/container/container_test.go | |
parent | c28f886c0bb0ff996e07fc133e0ebe1d842b496a (diff) |
Fix a nil pointer dereference bug in Container.Destroy()
In Container.Destroy(), we call c.stop() before calling
executeHooksBestEffort(), therefore, when we call
executeHooksBestEffort(c.Spec.Hooks.Poststop, c.State()) to execute
the poststop hook, it results in a nil pointer dereference since it
reads c.Sandbox.Pid in c.State() after the sandbox has been destroyed.
To fix this bug, we can change container's status to "stopped" before
executing the poststop hook.
Signed-off-by: ShiruRen <renshiru2000@gmail.com>
Change-Id: I4d835e430066fab7e599e188f945291adfc521ef
PiperOrigin-RevId: 230975505
Diffstat (limited to 'runsc/container/container_test.go')
0 files changed, 0 insertions, 0 deletions