mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: fix security vulnerabilities reported by CodeQL (#5467)
This commit is contained in:
@@ -611,6 +611,9 @@ func extractBin(dest string, r io.Reader) (numExtracted int, err error) {
|
||||
}
|
||||
return n, xerrors.Errorf("read tar archive failed: %w", err)
|
||||
}
|
||||
if h.Name == "." || strings.Contains(h.Name, "..") {
|
||||
continue
|
||||
}
|
||||
|
||||
name := filepath.Join(dest, filepath.Base(h.Name))
|
||||
f, err := os.Create(name)
|
||||
|
||||
Reference in New Issue
Block a user