Mercurial > vim
annotate src/version.h @ 33862:242b964d6269 v9.0.2140
patch 9.0.2140: [security]: use-after-free in win-enter
Commit: https://github.com/vim/vim/commit/eec0c2b3a4cfab93dd8d4adaa60638d47a2bbc8a
Author: Christian Brabandt <cb@256bit.org>
Date: Tue Nov 28 22:03:48 2023 +0100
patch 9.0.2140: [security]: use-after-free in win-enter
Problem: [security]: use-after-free in win-enter
Solution: validate window pointer before calling win_enter()
win_goto() may stop visual mode, if it is active. However, this may in
turn trigger the ModeChanged autocommand, which could potentially free
the wp pointer which was valid before now became stale and points to now
freed memory.
So before calling win_enter(), let's verify one more time, that the
wp pointer still points to a valid window structure.
Reported by @henices, thanks!
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Dec 2023 15:16:01 +0100 |
parents | f8116058ca76 |
children | 4635e43f2c6f |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
5294
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
7 | 2 * |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
5 * Do ":help uganda" in Vim to read copying and usage conditions. | |
6 * Do ":help credits" in Vim to see a list of people who contributed. | |
7 */ | |
8 | |
9 /* | |
10 * Define the version number, name, etc. | |
11 * The patchlevel is in included_patches[], in version.c. | |
12 */ | |
13 | |
18888
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
14 // Trick to turn a number into a string. |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
15 #define VIM_TOSTR_(a) #a |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
16 #define VIM_TOSTR(a) VIM_TOSTR_(a) |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
17 |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
18 // Values that change for a new release. |
29314 | 19 #define VIM_VERSION_MAJOR 9 |
20 #define VIM_VERSION_MINOR 0 | |
21 #define VIM_VERSION_BUILD 284 | |
22 #define VIM_VERSION_BUILD_BCD 0x11c | |
23 #define VIM_VERSION_DATE_ONLY "2022 Jun 28" | |
18888
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
24 |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
25 // Values based on the above |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
26 #define VIM_VERSION_MAJOR_STR VIM_TOSTR(VIM_VERSION_MAJOR) |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
27 #define VIM_VERSION_MINOR_STR VIM_TOSTR(VIM_VERSION_MINOR) |
7 | 28 #define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR) |
29 | |
18888
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
30 #define VIM_VERSION_BUILD_STR VIM_TOSTR(VIM_VERSION_BUILD) |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
31 #ifndef VIM_VERSION_PATCHLEVEL |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
32 # define VIM_VERSION_PATCHLEVEL 0 |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
33 #endif |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
34 #define VIM_VERSION_PATCHLEVEL_STR VIM_TOSTR(VIM_VERSION_PATCHLEVEL) |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
35 // Used by MacOS port; should be one of: development, alpha, beta, final |
5294 | 36 #define VIM_VERSION_RELEASE final |
7 | 37 |
38 /* | |
39 * VIM_VERSION_NODOT is used for the runtime directory name. | |
40 * VIM_VERSION_SHORT is copied into the swap file (max. length is 6 chars). | |
41 * VIM_VERSION_MEDIUM is used for the startup-screen. | |
42 * VIM_VERSION_LONG is used for the ":version" command and "Vim -h". | |
43 */ | |
18888
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
44 #define VIM_VERSION_NODOT "vim" VIM_VERSION_MAJOR_STR VIM_VERSION_MINOR_STR |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
45 #define VIM_VERSION_SHORT VIM_VERSION_MAJOR_STR "." VIM_VERSION_MINOR_STR |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
46 #define VIM_VERSION_MEDIUM VIM_VERSION_SHORT |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
47 #define VIM_VERSION_LONG_ONLY "VIM - Vi IMproved " VIM_VERSION_MEDIUM |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
48 #define VIM_VERSION_LONG_HEAD VIM_VERSION_LONG_ONLY " (" VIM_VERSION_DATE_ONLY |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
49 #define VIM_VERSION_LONG VIM_VERSION_LONG_HEAD ")" |
75e1ff65588e
patch 8.2.0005: duplication in version info
Bram Moolenaar <Bram@vim.org>
parents:
18879
diff
changeset
|
50 #define VIM_VERSION_LONG_DATE VIM_VERSION_LONG_HEAD ", compiled " |