Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in FromBytes functions #6

Open
tomtau opened this issue May 31, 2021 · 0 comments
Open

Panic in FromBytes functions #6

tomtau opened this issue May 31, 2021 · 0 comments

Comments

@tomtau
Copy link

tomtau commented May 31, 2021

Right now, it seems FromBytes functions assume the byte slices in arguments have correct lengths -- if not, they'll panic.
This assumption should ideally be documented or more explicitly handled (e.g. by returning a nil or an error instead of a panic).

An example panic:

panic: runtime error: index out of range [1] with length 1

goroutine 9 [running]:
encoding/binary.bigEndian.Uint16(...)
        /usr/local/go/src/encoding/binary/binary.go:101
github.com/taurusgroup/frost-ed25519/pkg/frost/party.FromBytes(...)
adr1anh added a commit that referenced this issue Jun 6, 2021
party.FromBytes now returns an error if the length of the given byte slice is too small
@adr1anh adr1anh mentioned this issue Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant