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

Internal HAMT error could cause panic #26

Open
ZenGround0 opened this issue Jun 5, 2019 · 1 comment
Open

Internal HAMT error could cause panic #26

ZenGround0 opened this issue Jun 5, 2019 · 1 comment

Comments

@ZenGround0
Copy link
Contributor

Is it ok that an inconsistently setup HAMT will cause a panic?
The pointer returned here is dereferenced without nil checking.

An inconsistent setup is actually checked earlier within the method returning the pointer here but it silently passes nil just deferring the panic to the caller.

It seems like this method should return an error or else own the decision to panic when in a bad state and not check the index against the length of the Pointers array.

@ZenGround0
Copy link
Contributor Author

A year has passed and the link has drifted out of date, but @rvagg made the same observation and recommends adding an error in comment: https://github.com/filecoin-project/go-hamt-ipld/blob/master/hamt.go#L745

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