Commit b49cb0ab authored by Noam Postavsky's avatar Noam Postavsky
Browse files

Fbackward_prefix_chars: stay within buffer bounds

The commit 1fd3172d "(Fbackward_prefix_chars): Set point properly while
scanning" (1998-03-18), moved the check against of the position against the
buffer beginning out the loop condition so that we might end up checking
the syntax of characters before the beginning of the buffer.  This can
cause segfaults or trigger a "Point before start of properties" error in
`update_interval' (called indirectly from `char_quoted').

* src/syntax.c (Fbackward_prefix_chars): Stop the loop when beginning of
buffer is reached (Bug #3552, Bug #17132, Bug #19379).
parent d765175e
......@@ -3098,8 +3098,9 @@ the prefix syntax flag (p). */)
opoint = pos;
opoint_byte = pos_byte;
if (pos + 1 > beg)
DEC_BOTH (pos, pos_byte);
if (pos <= beg)
DEC_BOTH (pos, pos_byte);
SET_PT_BOTH (opoint, opoint_byte);
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