lib/protocol: Fix OOR panic on recv-only folders (#7143)

This commit is contained in:
Simon Frei
2020-11-23 18:37:27 +01:00
committed by GitHub
parent 8e5c844370
commit 5d2c83a7e9
2 changed files with 29 additions and 1 deletions
+6 -1
View File
@@ -542,6 +542,11 @@ func isEncryptedParentFromComponents(pathComponents []string) bool {
return false
} else if l == 2 && len(pathComponents[1]) != 2 {
return false
} else if l == 0 {
return false
}
return pathComponents[0][1:1+len(encryptedDirExtension)] == encryptedDirExtension
if len(pathComponents[0]) == 0 {
return false
}
return pathComponents[0][1:] == encryptedDirExtension
}