Fix bug #16165 with memory corruption by extend_face_to_end_of_line.

src/xdisp.c (extend_face_to_end_of_line): Don't fill background of
 display margins on mode line, header line, and in the frame's
 tool-bar window.
This commit is contained in:
Eli Zaretskii 2013-12-16 19:59:50 +02:00
parent 062727ce6b
commit d865f6b555
2 changed files with 25 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2013-12-16 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (extend_face_to_end_of_line): Don't fill background of
display margins on mode line, header line, and in the frame's
tool-bar window. (Bug#16165)
2013-12-16 Andreas Schwab <schwab@suse.de>
* gnutls.c (Fgnutls_boot): Properly check Flistp return value.

View file

@ -18863,19 +18863,26 @@ extend_face_to_end_of_line (struct it *it)
it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id;
it->glyph_row->used[TEXT_AREA] = 1;
}
if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
&& it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
/* Mode line and the header line don't have margins, and
likewise the frame's tool-bar window, if there is any. */
if (!(it->glyph_row->mode_line_p
|| (WINDOWP (f->tool_bar_window)
&& it->w == XWINDOW (f->tool_bar_window))))
{
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
}
if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
&& it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
{
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0
&& it->glyph_row->used[LEFT_MARGIN_AREA] == 0)
{
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id;
it->glyph_row->used[LEFT_MARGIN_AREA] = 1;
}
if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0
&& it->glyph_row->used[RIGHT_MARGIN_AREA] == 0)
{
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph;
it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id;
it->glyph_row->used[RIGHT_MARGIN_AREA] = 1;
}
}
#ifdef HAVE_WINDOW_SYSTEM
if (it->glyph_row->reversed_p)