Prevent infinite loop when scanning for endstream (bug 1020226)
Merge pull request #4902 from Snuffleupagus/bug-1020226

Prevent infinite loop when scanning for endstream (bug 1020226)