Skip to content

Commit

Permalink
Merge pull request #157 from gabriel-samfira/check-user-object
Browse files Browse the repository at this point in the history
Fix potential nil pointer dereference
  • Loading branch information
tonistiigi authored Apr 7, 2023
2 parents a3696a2 + cb6895a commit 9e7a6df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions copy/mkdir_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ func Chown(p string, old *User, fn Chowner) error {
if err != nil {
return errors.WithStack(err)
}

userSIDstring := user.SID
var userSIDstring string
if user != nil && user.SID != "" {
userSIDstring = user.SID
}
if userSIDstring == "" {
userSIDstring = containerAdministratorSidString

Expand Down

0 comments on commit 9e7a6df

Please sign in to comment.