nametransform: Return error if decrypted name is '.' or '..'
This commit is contained in:
parent
f3c777d5ea
commit
c547673529
@ -65,6 +65,10 @@ func (n *NameTransform) DecryptName(cipherName string, iv []byte) (string, error
|
||||
if bytes.Contains(bin, []byte{0}) || bytes.Contains(bin, []byte("/")) {
|
||||
return "", syscall.EBADMSG
|
||||
}
|
||||
// The name should never be "." or "..".
|
||||
if bytes.Equal(bin, []byte(".")) || bytes.Equal(bin, []byte("..")) {
|
||||
return "", syscall.EBADMSG
|
||||
}
|
||||
plain := string(bin)
|
||||
return plain, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user