BUG: prevent nonzero memchr from running out of bounds
Merge pull request #4474 from juliantaylor/nonzero-bug

BUG: prevent nonzero memchr from running out of bounds