mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Fix possible array-out-of-bounds access, add test.
This commit is contained in:
parent
7f5dd9ab6b
commit
a958a33860
2 changed files with 25 additions and 1 deletions
|
@ -65,7 +65,7 @@ function lintContent(content, config) {
|
|||
token.line = lines[token.map[0]];
|
||||
token.lineNumber = token.map[0] + 1;
|
||||
// Trim bottom of token to exclude whitespace lines
|
||||
while (!(lines[token.map[1] - 1].trim())) {
|
||||
while (token.map[1] && !(lines[token.map[1] - 1].trim())) {
|
||||
token.map[1]--;
|
||||
}
|
||||
// Annotate children with lineNumber
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue