From 9ab37735f3cbcb68029cf5dfe195d4e6ec731d06 Mon Sep 17 00:00:00 2001 From: Richard Lehane Date: Sat, 14 Sep 2019 19:53:33 +0200 Subject: [PATCH] check for self recurse to prevent stack overflow; fixes #9 --- file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file.go b/file.go index 036d25c..88a9259 100644 --- a/file.go +++ b/file.go @@ -153,7 +153,7 @@ func (r *Reader) traverse() error { return } file := r.direntries[i] - if file.leftSibID != noStream { + if file.leftSibID != noStream && int(file.leftSibID) != i { recurse(int(file.leftSibID), path) } if len(r.File) >= cap(r.File) {