From 2ae3c93bb0eb42cd7362c5c9604428bd29ae756c Mon Sep 17 00:00:00 2001 From: Fryyyyy Date: Thu, 28 Nov 2024 17:15:06 +1100 Subject: [PATCH] Check error before opening file (#1574) --- tools/fraken/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/fraken/main.go b/tools/fraken/main.go index 92974c199..9bd98c3e2 100644 --- a/tools/fraken/main.go +++ b/tools/fraken/main.go @@ -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 }