go-libp2p-core/internal/catch
Steven Allen 648dc3fba2
feat: harden encoding/decoding functions against panics (#243)
* feat: harden encoding/decoding functions against panics

Part of https://github.com/libp2p/go-libp2p/issues/1389

These kinds of functions:

1. Handle user input.
2. Often have out-of-bounds, null pointer, etc bugs.
3. Have completely isolated logic where local panics are unlikely to
   cause memory corruption elsewhere.

* test: add a panic catcher test
2022-04-18 12:40:37 -07:00
..
catch_test.go feat: harden encoding/decoding functions against panics (#243) 2022-04-18 12:40:37 -07:00
catch.go feat: harden encoding/decoding functions against panics (#243) 2022-04-18 12:40:37 -07:00