You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is soooo cool!
![the thing](the_thing.jpg =120x60)
Will fail with a StringIndexOutOfBoundsException.
The issue is with ResizableImageInlineParserExtension.java
@Override
public boolean parse(@NotNull LightInlineParser inlineParser) {
int index = inlineParser.getIndex();
char c = inlineParser.getInput().charAt(index + 1);
if (c == '[') {
BasedSequence[] matches = inlineParser.matchWithGroups(IMAGE_PATTERN);
Note the use of index + 1 without a prior bounds check. The offending exclamation mark happens to be at the end of a block, so the index + 1 character check for a following [ puts us past the end of the block, and out of range.
Expected behavior
If the input is not long enough to check the next character, it's clearly not going to be a [. This shouldn't crash. :-)
The text was updated successfully, but these errors were encountered:
A markdown block like:
Will fail with a
StringIndexOutOfBoundsException
.The issue is with ResizableImageInlineParserExtension.java
Note the use of
index + 1
without a prior bounds check. The offending exclamation mark happens to be at the end of a block, so the index + 1 character check for a following[
puts us past the end of the block, and out of range.Expected behavior
If the input is not long enough to check the next character, it's clearly not going to be a
[
. This shouldn't crash. :-)The text was updated successfully, but these errors were encountered: