Skip to content

Commit bfe4a9d

Browse files
authored
Merge pull request #834 from mackerelio/fix-check-log-nil-ptr
Fix: check-log panic with invalid memory address or nil pointer dereference
2 parents e59230a + eb5539e commit bfe4a9d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

check-log/lib/check-log.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ func findFileByInode(inode uint, dir string) (string, error) {
571571
if err != nil && !errors.Is(err, os.ErrNotExist) {
572572
return "", err
573573
}
574+
if fi == nil {
575+
continue
576+
}
574577
if detectInode(fi) == inode {
575578
return filepath.Join(dir, fi.Name()), nil
576579
}

0 commit comments

Comments
 (0)