diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-16 16:49:24 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-16 16:49:24 +0100 |
commit | ca7e86c23789eb0ed8f6400f25ea9e0e1036f9fc (patch) | |
tree | ad44a49e8abeb22729ae8546bfcbcc9db887eb08 /src/syntax.c | |
parent | e0805b849ce60f65149903b63584d49bf81f975e (diff) | |
download | vim-git-ca7e86c23789eb0ed8f6400f25ea9e0e1036f9fc.tar.gz |
patch 8.2.4762: using freed memory using synstack() and synID() in WinEnterv8.2.4762
Problem: Using freed memory when using synstack() and synID() in WinEnter.
Solution: Check using the syntax window. (closes #10204)
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/syntax.c b/src/syntax.c index 086d9d755..6b71e8dfa 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6486,8 +6486,9 @@ syn_get_id( int keep_state) // keep state of char at "col" { // When the position is not after the current position and in the same - // line of the same buffer, need to restart parsing. - if (wp->w_buffer != syn_buf + // line of the same window with the same buffer, need to restart parsing. + if (wp != syn_win + || wp->w_buffer != syn_buf || lnum != current_lnum || col < current_col) syntax_start(wp, lnum); |