summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-10 20:50:23 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-10 20:50:23 +0100
commit87f3a2ca3d0ffbfa7389bbb89add4d8d3fca6fbb (patch)
tree4d3a5d95cf79ee3f671a2969a620f5ddcb4c102b
parent82b14c143aa1e70d55509cc9fa408828e90c93de (diff)
patch 9.0.0189: invalid memory access for text prop without highlightv9.0.0189
Problem: Invalid memory access for text prop without highlight. Solution: Check for a valid highlight ID.
-rw-r--r--src/drawline.c3
-rw-r--r--src/highlight.c1
-rw-r--r--src/version.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/drawline.c b/src/drawline.c
index d38cf7347b..2b482bb2db 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1710,7 +1710,8 @@ win_line(
|| text_props[tpi].tp_id < 0)
&& text_props[tpi].tp_id != -MAXCOL)
{
- used_attr = syn_id2attr(pt->pt_hl_id);
+ 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);
diff --git a/src/highlight.c b/src/highlight.c
index 2542c7b202..c373afb957 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -3504,6 +3504,7 @@ syn_unadd_group(void)
/*
* Translate a group ID to highlight attributes.
+ * "hl_id" must be valid: > 0, caller must check.
*/
int
syn_id2attr(int hl_id)
diff --git a/src/version.c b/src/version.c
index 6675c3a4a5..03a8091e6e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 189,
+/**/
188,
/**/
187,