From 347d9bbe01304b571d497eb60b5891044b428798 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 17 Nov 2006 12:12:15 +0000 Subject: [PATCH] (simple_search): In the loop of backward searching, check also the byte position against the limit. --- src/ChangeLog | 5 +++++ src/search.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index c799feb1b3a..2f7149e6e94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-11-17 NIIMI Satoshi (tiny change) + + * search.c (simple_search): In the loop of backward searching, + check also the byte position against the limit. + 2006-11-14 Romain Francoise * minibuf.c (Fcompleting_read): Fix typo in docstring. diff --git a/src/search.c b/src/search.c index 7c3151b76b8..d6572c5397a 100644 --- a/src/search.c +++ b/src/search.c @@ -1514,7 +1514,7 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte) 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) -- 2.39.5