From fcd9b9d0f8c9c59f74b4ebb11bb446b1413b4c2f Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 25 Feb 2005 21:50:21 +0000 Subject: [PATCH] (init_from_display_pos): Don't read past end of it->overlay_strings array. --- src/xdisp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index dd10551d5fa..8d977ea20fb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2538,7 +2538,10 @@ init_from_display_pos (it, w, pos) after-string. */ init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID); - for (i = 0; i < it->n_overlay_strings; ++i) + /* This only scans the current chunk -- it should scan all chunks. + However, OVERLAY_STRING_CHUNK_SIZE has been increased from 3 in 21.1 + to 16 in 22.1 to make this a lesser problem. */ + for (i = 0; i < it->n_overlay_strings && i < OVERLAY_STRING_CHUNK_SIZE; ++i) { const char *s = SDATA (it->overlay_strings[i]); const char *e = s + SBYTES (it->overlay_strings[i]); -- 2.39.5