瀏覽代碼

Windows: Fix AV in build due to userns

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 9 年之前
父節點
當前提交
6d71f27760
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      pkg/archive/diff.go

+ 7 - 0
pkg/archive/diff.go

@@ -25,6 +25,13 @@ func UnpackLayer(dest string, layer Reader, options *TarOptions) (size int64, er
 	defer pools.BufioReader32KPool.Put(trBuf)
 
 	var dirs []*tar.Header
+
+	if options == nil {
+		options = &TarOptions{}
+	}
+	if options.ExcludePatterns == nil {
+		options.ExcludePatterns = []string{}
+	}
 	remappedRootUID, remappedRootGID, err := idtools.GetRootUIDGID(options.UIDMaps, options.GIDMaps)
 	if err != nil {
 		return 0, err