Always read aligned words, invalidating unwanted bytes in first word, and checking that any match in the last word is before the buffer end. No loops apart from the one through the data.