Skip to content

Commit

Permalink
prevent panic on bad dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlehane committed Apr 18, 2015
1 parent 9a75b5c commit 109c580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (r *Reader) traverse() error {
var recurse func(i int, path []string)
var err error
recurse = func(i int, path []string) {
if i < 0 || i >= len(r.File) {
if i < 0 || i >= len(r.File) || idx >= len(r.indexes) {
err = ErrBadDir
return
}
Expand Down

0 comments on commit 109c580

Please sign in to comment.