0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

croc checks for error in file name

This commit is contained in:
Zack 2024-06-26 06:58:12 -07:00
parent 3e804a4a09
commit 7c3dc4453a

View file

@ -1210,8 +1210,9 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error
return true, fmt.Errorf("invalid path detected: '%s'", fi.FolderRemote) return true, fmt.Errorf("invalid path detected: '%s'", fi.FolderRemote)
} }
// Issue #595 - disallow filenames with invisible characters // Issue #595 - disallow filenames with invisible characters
if !utils.ValidFileName(path.Join(c.FilesToTransfer[i].FolderRemote, fi.Name)) { errFileName := utils.ValidFileName(path.Join(c.FilesToTransfer[i].FolderRemote, fi.Name))
return true, fmt.Errorf("invalid filename detected: '%s'", fi.Name) if errFileName != nil {
return true, errFileName
} }
} }
c.TotalNumberOfContents = 0 c.TotalNumberOfContents = 0