Merge pull request #10238 from bacher09/fix-inf-loop

Fix infinite loop in isPathOnVolume
This commit is contained in:
OpenShift Merge Robot
2021-05-07 05:33:25 -04:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -128,7 +128,7 @@ func isPathOnVolume(c *Container, containerPath string) bool {
if cleanedContainerPath == filepath.Clean(vol.Dest) {
return true
}
for dest := vol.Dest; dest != "/"; dest = filepath.Dir(dest) {
for dest := vol.Dest; dest != "/" && dest != "."; dest = filepath.Dir(dest) {
if cleanedContainerPath == dest {
return true
}