Fix read from invalid memory in iterator
Fix read from invalid memory in iterator

The problem here was a short-circuit evaluation of the termination
condition - even if the result iterator is at the end, we would have
been accessing its terminal member illegally.

Baltoli/peggo,Baltoli/peggo