Skip to content

Commit 2ae3c93

Browse files
authored
Check error before opening file (#1574)
1 parent 2e18b0b commit 2ae3c93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/fraken/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ func filesystemScan(wait chan struct{}, c chan *Detection, minimumScore int) {
351351
}
352352
var wg sync.WaitGroup
353353
err := filepath.Walk(*scanPathFlag, func(filePath string, fileInfo os.FileInfo, err error) error {
354+
if err != nil {
355+
log.Printf("Error walking dir %v: %v\n", filePath, err)
356+
return err
357+
}
354358
if !fileInfo.Mode().IsRegular() {
355359
return nil
356360
}

0 commit comments

Comments
 (0)