safeCall invokes a fuzz harness, recovering from any panic and returning the harness result or -1 on panic.
(fn func([]byte) int, in []byte)
| 991 | // safeCall invokes a fuzz harness, recovering from any panic and returning |
| 992 | // the harness result or -1 on panic. |
| 993 | func safeCall(fn func([]byte) int, in []byte) int { |
| 994 | var v int |
| 995 | defer func() { |
| 996 | if r := recover(); r != nil { |
| 997 | v = -1 |
| 998 | } |
| 999 | }() |
| 1000 | v = fn(in) |
| 1001 | return v |
| 1002 | } |
| 1003 | |
| 1004 | // --------------------------------------------------------------------------- |
| 1005 | // Property: every public surface is panic-free on random bytes (universal) |
no outgoing calls
no test coverage detected