提交 b5f1cf80 编写于 作者: T Thomas Stromberg

Fix nil pointer dereference on error

上级 170f5773
......@@ -81,6 +81,11 @@ func TestChangeNoneUser(t *testing.T) {
info, err := os.Stat(p)
if err != nil {
t.Errorf("stat(%s): %v", p, err)
continue
}
if info == nil && info.Sys() == nil {
t.Errorf("nil info for %s", p)
continue
}
got := info.Sys().(*syscall.Stat_t).Uid
if got != uint32(uid) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册