# HG changeset patch # User Kim F. Storm # Date 1109368221 0 # Node ID 825c64cf8e7c1e2522f142e916246e010aad72a2 # Parent b22562d329a7350ed722cef01f0522634c75f518 (init_from_display_pos): Don't read past end of it->overlay_strings array. diff -r b22562d329a7 -r 825c64cf8e7c src/xdisp.c --- a/src/xdisp.c Fri Feb 25 21:49:59 2005 +0000 +++ b/src/xdisp.c Fri Feb 25 21:50:21 2005 +0000 @@ -2538,7 +2538,10 @@ 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]);