Skip to content

Commit

Permalink
Check error before opening file (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryyyyy authored Nov 28, 2024
1 parent 2e18b0b commit 2ae3c93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/fraken/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ func filesystemScan(wait chan struct{}, c chan *Detection, minimumScore int) {
}
var wg sync.WaitGroup
err := filepath.Walk(*scanPathFlag, func(filePath string, fileInfo os.FileInfo, err error) error {
if err != nil {
log.Printf("Error walking dir %v: %v\n", filePath, err)
return err
}
if !fileInfo.Mode().IsRegular() {
return nil
}
Expand Down

0 comments on commit 2ae3c93

Please sign in to comment.