fuzz: Fix index out of range for results without content
Offending crasher: "\n\n\n\n\n\n\n\n\n#+RESULTS:"
This commit is contained in:
parent
d85768891c
commit
55b149054d
1 changed files with 3 additions and 0 deletions
|
@ -105,6 +105,9 @@ func (d *Document) parseExample(i int, parentStop stopFn) (int, Node) {
|
|||
}
|
||||
|
||||
func (d *Document) parseResult(i int, parentStop stopFn) (int, Node) {
|
||||
if i+1 >= len(d.tokens) {
|
||||
return 0, nil
|
||||
}
|
||||
consumed, node := d.parseOne(i+1, parentStop)
|
||||
return consumed + 1, Result{node}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue