Skip to content

Possible index out of bounds in comment parsing code #17

@Mingun

Description

@Mingun

Code here will panic on input .<!-:

let peek4 = pos + 3;
if input.len() < peek4 {
return None;
}
match input[peek4] {

index out of bounds: the len is 4 but the index is 4

Need to use <= as in all similar places. I don't do PR because I'm not sure what your test policy is, and currently I don't have time to write them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions