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

ArrayIndexOutOfBoundsException #45

Closed
0x3333 opened this issue Jun 10, 2017 · 6 comments
Closed

ArrayIndexOutOfBoundsException #45

0x3333 opened this issue Jun 10, 2017 · 6 comments
Assignees
Labels

Comments

@0x3333
Copy link
Collaborator

0x3333 commented Jun 10, 2017

From issue Issue 43 - kmandeville:

I have found two other occurrences where I get ArrayIndexOutOfBoundsException from deep in the HashIds code.
Hashids hashids = new Hashids("this is my salt"); long[] numbers = hashids.decode("[]");

and

Hashids hashids = new Hashids("this is my salt"); long[] numbers = hashids.decode("()");

Like the original submitter above, these aren't valid hashes, but I'm running into these errors in my web app because someone COULD put these characters in as an ID in a URL accidentally or on purpose. My app is just passing in these characters directly into HashIds. I would expect something other than ArrayIndexOutOfBoundsExceptions.

@0x3333 0x3333 added the bug label Jun 10, 2017
@0x3333 0x3333 self-assigned this Jun 10, 2017
0x3333 added a commit that referenced this issue Jun 10, 2017
@0x3333
Copy link
Collaborator Author

0x3333 commented Jun 10, 2017

Fixed, instead finding all charAt that could throw an ArrayIndexOutOfBoundsException, I validate the decode method input, in case of invalid chars, return an empty array(Default JS implementation behaviour).

@0x3333 0x3333 closed this as completed Jun 10, 2017
@kmandeville
Copy link

Will there be a new release in the near future? I'd rather not have to use a snapshot version

@0x3333
Copy link
Collaborator Author

0x3333 commented Jun 14, 2017

@kmandeville I don't think this fix should produce a new release, I issued a release May 29, 2017.

I'm waiting fanweixiao response about removing some deprecated methods and after his response a new release should be issued on July/August...

@kmandeville
Copy link

I didn't expect there to be one just for this fix. Was just wondering what the current plan was so I could plan on my side accordingly. Thank you!

@0x3333
Copy link
Collaborator Author

0x3333 commented Jun 14, 2017

No problem! Subscribe to the issue #44 , when it got fixed probably we will have a new release! Thanks for your help!

@0x3333
Copy link
Collaborator Author

0x3333 commented Aug 4, 2017

Just to inform a new version has been issued! 1.0.3.

@kmandeville kmandeville mentioned this issue May 23, 2018
3 tasks
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