# HG changeset patch # User Kenichi Handa # Date 1163765525 0 # Node ID 94626132135da277d58a3dfd714b8bcc4caff70a # Parent ee10cd92b99c732953fbbfdf2b3a2c1f4cc0e0a3 (simple_search): In the loop of backward searching, check also the byte position against the limit. diff -r ee10cd92b99c -r 94626132135d src/search.c --- a/src/search.c Fri Nov 17 07:57:11 2006 +0000 +++ b/src/search.c Fri Nov 17 12:12:05 2006 +0000 @@ -1514,7 +1514,7 @@ int this_len_byte = len_byte; unsigned char *p = pat; - if (pos - len < lim) + if (this_pos < lim || this_pos_byte < lim_byte) goto stop; while (this_len > 0)