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

Fix IndexOutOfBounds #74

Closed
wants to merge 1 commit into from
Closed

Fix IndexOutOfBounds #74

wants to merge 1 commit into from

Conversation

Sanduhr32
Copy link

@Sanduhr32 Sanduhr32 commented Aug 10, 2022

Pull Request

Pull Request Checklist

Please follow the following steps before opening this PR.

PRs that do not complete the checklist will be subject to denial for
missing information.

  • I have checked the [pull request page][pull-request] for upcoming
    or merged features/bug fixes.
  • I have read JDA's [contributing guidelines][contributing].

Pull Request Information

Check and fill in the blanks for all that apply:

  • My PR fixes a bug, error, or other issue with the library's codebase.
  • My PR is for the command module of the JDA-Utilities library.

Description

fixes an index out of bounds when trying to make message parts, when the raw message is a bot mention only.
Edit:
line 903 or 917 would fail either way if the index is beyond rawLength

  1. substring(start, end) https://github.com/openjdk/jdk17/blob/master/src/java.base/share/classes/java/lang/String.java#L2704 (calls point 2)
  2. ("checkIndices") https://github.com/openjdk/jdk17/blob/master/src/java.base/share/classes/java/lang/String.java#L4599-L4604

GameKuchen
GameKuchen approved these changes Aug 14, 2022
@Chew
Copy link
Owner

Chew commented Aug 20, 2022

I could swear this was fixed or was reported or something. That's why I haven't replied yet since I don't remember 😂

@Chew
Copy link
Owner

Chew commented Aug 20, 2022

Ah it's just #60 / #61

@Chew Chew added the module: command Commands module label Aug 20, 2022
@Sanduhr32
Copy link
Author

/shrug that seemed todo a lot that isn't required.

@Chew
Copy link
Owner

Chew commented Aug 22, 2022

This seems more like a band-aid fix, I want to test some other methods to see what the root issue is. Will investigate.

@Sanduhr32
Copy link
Author

It overscans the full message string, if it's just the mention as the commands prefix

@Sanduhr32 Sanduhr32 closed this Oct 23, 2022
@GameKuchen
Copy link

I'm still having issues with this error getting dropped? Any news on this?

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

Successfully merging this pull request may close these issues.

3 participants