Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

index out of range panic in scanLinkRef #172

Closed
ghost opened this issue Jun 3, 2015 · 0 comments
Closed

index out of range panic in scanLinkRef #172

ghost opened this issue Jun 3, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 3, 2015

The below program panics:

package main

import "github.com/russross/blackfriday"

func main() {
    blackfriday.MarkdownCommon([]byte("[]:<"))
}
tw4452852 added a commit to tw4452852/blackfriday that referenced this issue Jun 8, 2015
Add checking before accessing the input data.

Fix russross#172 and russross#173 issues.

Signed-off-by: Tw <tw19881113@gmail.com>
@rtfb rtfb closed this as completed in #176 Jun 8, 2015
rtfb added a commit that referenced this issue Apr 21, 2016
Fix regession: index out of range panic in reference link (#172, #173)
dmitshur added a commit that referenced this issue Jul 15, 2016
These will be helpful for catching regressions or changes in behavior
to edge cases such as empty input, or specifically crafted inputs that
may cause panics, etc.

Move test for issue #172 there since it's a document-level test, not an
inline one.

Add test for issue #173.

Make some things more consistent.

Don't use a named receiver in methods that don't use it. This makes the
code more readable since one can more quickly tell the inputs to the
method.
rtfb added a commit that referenced this issue Feb 12, 2017
The check was introduced with d28de22, when fixing #172 and #173.
Then I removed it with bcd6dd8 when fixing #180
And then it was reintroduced with 232d06c when fixing regression.

It seems that the check can be removed again. All these cases now have
tests (including the one from 69f51af, which seems to have landed to v1
only, copying it here) and they all pass.
@rtfb rtfb mentioned this issue Feb 12, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants