Commit 588d2fd5 authored by Karl Heuer's avatar Karl Heuer
Browse files

(search_command): Check LIM in valid range

before calling CHAR_TO_BYTE.
parent 9c8de95c
......@@ -880,13 +880,14 @@ search_command (string, bound, noerror, count, direction, RE, posix)
{
CHECK_NUMBER_COERCE_MARKER (bound, 1);
lim = XINT (bound);
lim_byte = CHAR_TO_BYTE (lim);
if (n > 0 ? lim < PT : lim > PT)
error ("Invalid search bound (wrong side of point)");
if (lim > ZV)
lim = ZV, lim_byte = ZV_BYTE;
if (lim < BEGV)
else if (lim < BEGV)
lim = BEGV, lim_byte = BEGV_BYTE;
else
lim_byte = CHAR_TO_BYTE (lim);
}
np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment