coral-xyz / anchor

⚓ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.36k stars 1.25k forks source link

idl: Fix potential panic on external type resolution #2954

Closed acheroncrypto closed 1 month ago

acheroncrypto commented 1 month ago

Problem

find_path function used in non-Anchor external type resolution can potentially panic if the file we're looking for doesn't exist in any of the ancestors.

This can happen in rare cases such as the recursive external type resolution described in https://github.com/coral-xyz/anchor/pull/2946.

Summary of changes

Rewrite the find_path function without a potential panic.

vercel[bot] commented 1 month ago

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.