You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
panic: runtime error: index out of range [8] with length 5 [recovered]
panic: runtime error: index out of range [8] with length 5
goroutine 19 [running]:
testing.tRunner.func1.2({0x5dd0c0, 0xc0000f6180})
/usr/local/go/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1634 +0x377
panic({0x5dd0c0?, 0xc0000f6180?})
/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/nspcc-dev/neo-go/pkg/io.PutVarUint(...)
/home/ll/projects/neo/go/pkg/io/binaryWriter.go:109
github.com/nspcc-dev/neo-go/pkg/io_test.TestPutVarUint(0xc0000d8b60?)
This one was added specifically as canary (17a3f17). At the same time users of this API can expect some symmetry between GetVarSize() and PutVarUint(). And it'll fail later if buffer is too short.
Current Behavior
Expected Behavior
no panic when buffer has enough len, only otherwise (similar to https://pkg.go.dev/encoding/binary#PutUvarint)
Possible Solution
do not do
neo-go/pkg/io/binaryWriter.go
Line 109 in 9189b3e
Steps to Reproduce
Regression
no
Your Environment
The text was updated successfully, but these errors were encountered: