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:
Niklas Fasching 2020-06-28 21:26:02 +02:00
parent d85768891c
commit 55b149054d

View file

@ -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}
}