Skip to content

Commit

Permalink
croc checks for error in file name
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Jun 26, 2024
1 parent 3e804a4 commit 7c3dc44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/croc/croc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
// Issue #595 - disallow filenames with invisible characters
if !utils.ValidFileName(path.Join(c.FilesToTransfer[i].FolderRemote, fi.Name)) {
return true, fmt.Errorf("invalid filename detected: '%s'", fi.Name)
errFileName := utils.ValidFileName(path.Join(c.FilesToTransfer[i].FolderRemote, fi.Name))
if errFileName != nil {
return true, errFileName
}
}
c.TotalNumberOfContents = 0
Expand Down

0 comments on commit 7c3dc44

Please sign in to comment.