From a6b0f45d2c5a5df6c5a0dc8b82093f0c8b14b924 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 30 May 2023 11:03:36 +0200 Subject: [PATCH] Fix infinite recursion when resolving ldcache Signed-off-by: Evan Lezar --- internal/ldcache/ldcache.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ldcache/ldcache.go b/internal/ldcache/ldcache.go index 1fe7d074..96e52675 100644 --- a/internal/ldcache/ldcache.go +++ b/internal/ldcache/ldcache.go @@ -293,6 +293,9 @@ func (c *ldcache) resolve(target string) (string, error) { if err != nil { return "", fmt.Errorf("failed to resolve symlink: %v", err) } + if link == name { + return name, nil + } // We return absolute paths for all targets if !filepath.IsAbs(link) || strings.HasPrefix(link, ".") {