btcsuite / btcutil

Provides bitcoin-specific convenience functions and types
475 stars 408 forks source link

Fix infinite recursion when printing error #198

Closed guggero closed 3 years ago

guggero commented 3 years ago

Commit 24e673ae introduced a bug that cause the Error() function to call itself recursively forever, causing a stack overflow. We explicitly cast the error to its base type to avoid the recursion and add a small test case that would've triggered the bug before.