From: Eli Zaretskii Date: Fri, 21 Apr 2017 08:10:14 +0000 (+0300) Subject: Avoid infinite loop in redisplay when header-line-format is invalid X-Git-Tag: emacs-26.0.90~521^2~583 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=72d7961d678f9c5f4cb812e0bb9b6dffafb47c68;p=emacs.git Avoid infinite loop in redisplay when header-line-format is invalid * src/xdisp.c (handle_invisible_prop): Avoid inflooping when the string has an invalid %-construct in it and is displayed as part of mode-line or header-line. (Bug#26586) --- diff --git a/src/xdisp.c b/src/xdisp.c index 58b5ca2f018..3e6a3078cea 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4318,7 +4318,8 @@ handle_invisible_prop (struct it *it) bidi_move_to_visually_next (&it->bidi_it); } while (oldpos <= it->bidi_it.charpos - && it->bidi_it.charpos < endpos); + && it->bidi_it.charpos < endpos + && it->bidi_it.charpos < it->bidi_it.string.schars); IT_STRING_CHARPOS (*it) = it->bidi_it.charpos; IT_STRING_BYTEPOS (*it) = it->bidi_it.bytepos;