Skip to content

Commit

Permalink
fix: Avoid panic in config finder (#686)
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Eknert <anders@styra.com>
  • Loading branch information
anderseknert committed Apr 26, 2024
1 parent 0c3043d commit e170834
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/config/config.go
Expand Up @@ -139,6 +139,10 @@ func FindRegalDirectory(path string) (*os.File, error) {
return nil, errors.New("stopping as dir is empty string")
}

if len(parts) < 2 {
return nil, errors.New("stopping as dir is root directory")
}

parts = parts[:len(parts)-1]

if parts[0] == volume {
Expand Down

0 comments on commit e170834

Please sign in to comment.