To: vim_dev@googlegroups.com Subject: Patch 9.0.0189 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0189 Problem: Invalid memory access for text prop without highlight. Solution: Check for a valid highlight ID. Files: src/highlight.c, src/drawline.c *** ../vim-9.0.0188/src/highlight.c 2022-07-23 09:52:00.337814264 +0100 --- src/highlight.c 2022-08-10 20:44:41.721792343 +0100 *************** *** 3504,3509 **** --- 3504,3510 ---- /* * Translate a group ID to highlight attributes. + * "hl_id" must be valid: > 0, caller must check. */ int syn_id2attr(int hl_id) *** ../vim-9.0.0188/src/drawline.c 2022-08-10 16:48:59.395127789 +0100 --- src/drawline.c 2022-08-10 20:45:36.777757408 +0100 *************** *** 1710,1716 **** || text_props[tpi].tp_id < 0) && text_props[tpi].tp_id != -MAXCOL) { ! used_attr = syn_id2attr(pt->pt_hl_id); text_prop_type = pt; text_prop_attr = hl_combine_attr(text_prop_attr, used_attr); --- 1710,1717 ---- || text_props[tpi].tp_id < 0) && text_props[tpi].tp_id != -MAXCOL) { ! if (pt->pt_hl_id > 0) ! used_attr = syn_id2attr(pt->pt_hl_id); text_prop_type = pt; text_prop_attr = hl_combine_attr(text_prop_attr, used_attr); *** ../vim-9.0.0188/src/version.c 2022-08-10 19:50:44.117894641 +0100 --- src/version.c 2022-08-10 20:49:45.193579915 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 189, /**/ -- Facepalm statement #8: "Drive faster, the petrol is running out" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///