fix: disallow file name too long when writing a file (#4881)
* fix: disallow file name too long when writing a file * bool LongerName to MaxFilenameLength --------- Co-authored-by: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.co>
This commit is contained in:
committed by
GitHub
parent
edee91ef0e
commit
1cac5d983d
@@ -29,6 +29,13 @@ func (fp FullPath) Name() string {
|
||||
return name
|
||||
}
|
||||
|
||||
func (fp FullPath) IsLongerFileName(maxFilenameLength uint32) bool {
|
||||
if maxFilenameLength == 0 {
|
||||
return false
|
||||
}
|
||||
return uint32(len([]byte(fp.Name()))) > maxFilenameLength
|
||||
}
|
||||
|
||||
func (fp FullPath) Child(name string) FullPath {
|
||||
dir := string(fp)
|
||||
noPrefix := name
|
||||
|
||||
Reference in New Issue
Block a user