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

GeoHash#encodeHash(double, double, int) allows invalid 'length' #29

Closed
ShibaBandit opened this issue Aug 2, 2017 · 2 comments
Closed
Labels

Comments

@ShibaBandit
Copy link

Nested call to GeoHash#fromLongToString(long) does a range check on a hash, but only catches some invalid cases. I can pass in 20 for the length in encodeHash() for example and I wind up with a shorter hash instead of an error. Passing in 13 for the length throws an error.

@davidmoten
Copy link
Owner

Editing title because is the (double, double, int) signature

@davidmoten davidmoten changed the title GeoHash#encodeHash(double, double, long) allows invalid 'length' GeoHash#encodeHash(double, double, int) allows invalid 'length' Aug 3, 2017
@davidmoten davidmoten added the bug label Aug 3, 2017
davidmoten added a commit that referenced this issue Aug 3, 2017
fix #29 add precondition check for encodeHash length parameter
@davidmoten
Copy link
Owner

Thanks for the report @ShibaBandit! Fix has been applied and new release is on Maven Central now (0.7.6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants