1) Bounds checking. The algorithm can read past the end of the text. Putting in a test "if (first + len < n)" before verification fixes that.
2) BSX, BSX1 and BSX3 were missing some restrictions on the length of m. Adding those in (as per the other implementations) fixes that.
1) Bounds checking. The algorithm can read past the end of the text. Putting in a test "if (first + len < n)" before verification fixes that. 2) BSX, BSX1 and BSX3 were missing some restrictions on the length of m. Adding those in (as per the other implementations) fixes that.