From aac1f8ddd525c8a02bb9b653bdccf24a179d8db5 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 24 Jan 2014 07:53:16 +0400 Subject: [PATCH] * xdisp.c (reseat_1, Fcurrent_bidi_paragraph_direction): Avoid undefined behavior by initializing display property bit of a string processed by the bidirectional iterator. For details, see . --- src/ChangeLog | 7 +++++++ src/xdisp.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index d0d72dd6016..6dbaa5cbcf2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-01-24 Dmitry Antipov + + * xdisp.c (reseat_1, Fcurrent_bidi_paragraph_direction): Avoid + undefined behavior by initializing display property bit of a + string processed by the bidirectional iterator. For details, see + . + 2014-01-23 Paul Eggert Minor cleanup of previous change. diff --git a/src/xdisp.c b/src/xdisp.c index bd6630a23c3..e59612696e9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6409,6 +6409,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p) it->bidi_it.string.s = NULL; it->bidi_it.string.lstring = Qnil; it->bidi_it.string.bufpos = 0; + it->bidi_it.string.from_disp_str = 0; it->bidi_it.string.unibyte = 0; it->bidi_it.w = it->w; } @@ -20411,6 +20412,7 @@ See also `bidi-paragraph-direction'. */) itb.string.s = NULL; itb.string.lstring = Qnil; itb.string.bufpos = 0; + itb.string.from_disp_str = 0; itb.string.unibyte = 0; /* We have no window to use here for ignoring window-specific overlays. Using NULL for window pointer will cause