Skip to content

Commit

Permalink
Merge pull request #6919 from tstromberg/test-panic
Browse files Browse the repository at this point in the history
none_test: Fix nil pointer dereference on stat error
  • Loading branch information
medyagh authored Mar 6, 2020
2 parents 5bcdd62 + 318f9f2 commit 987964b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/integration/none_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 987964b

Please sign in to comment.