annotate .hgignore @ 33811:06219b3bdaf3 v9.0.2121

patch 9.0.2121: [security]: use-after-free in ex_substitute Commit: https://github.com/vim/vim/commit/26c11c56888d01e298cd8044caf860f3c26f57bb Author: Christian Brabandt <cb@256bit.org> Date: Wed Nov 22 21:26:41 2023 +0100 patch 9.0.2121: [security]: use-after-free in ex_substitute Problem: [security]: use-after-free in ex_substitute Solution: always allocate memory closes: #13552 A recursive :substitute command could cause a heap-use-after free in Vim (CVE-2023-48706). The whole reproducible test is a bit tricky, I can only reproduce this reliably when no previous substitution command has been used yet (which is the reason, the test needs to run as first one in the test_substitute.vim file) and as a combination of the `:~` command together with a :s command that contains the special substitution atom `~\=` which will make use of a sub-replace special atom and calls a vim script function. There was a comment in the existing :s code, that already makes the `sub` variable allocate memory so that a recursive :s call won't be able to cause any issues here, so this was known as a potential problem already. But for the current test-case that one does not work, because the substitution does not start with `\=` but with `~\=` (and since there does not yet exist a previous substitution atom, Vim will simply increment the `sub` pointer (which then was not allocated dynamically) and later one happily use a sub-replace special expression (which could then free the `sub` var). The following commit fixes this, by making the sub var always using allocated memory, which also means we need to free the pointer whenever we leave the function. Since sub is now always an allocated variable, we also do no longer need the sub_copy variable anymore, since this one was used to indicated when sub pointed to allocated memory (and had therefore to be freed on exit) and when not. Github Security Advisory: https://github.com/vim/vim/security/advisories/GHSA-c8qm-x72m-q53q Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 22 Nov 2023 22:15:05 +0100
parents 7aeaf20e2ba5
children 6e66a52748d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 syntax: glob
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 # Unixen: object and executable files.
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 *.o
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 src/vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 src/xxd/xxd
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 src/auto/if_perl.c
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 src/auto/gui_gtk_gresources.c
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 src/auto/gui_gtk_gresources.h
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
10 src/auto/os_haiku.rdef
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 src/objects/.dirstamp
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 src/objects
19093
af70e0c2b3cd patch 8.2.0107: hgignore is out of sync from gitignore
Bram Moolenaar <Bram@vim.org>
parents: 17157
diff changeset
13 src/types.vim
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 # We do need src/auto/configure.
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 src/auto/config.cache
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 src/auto/config.h
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 src/auto/config.log
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 src/auto/config.mk
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 src/auto/config.status
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 src/auto/osdef.h
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 src/auto/link.log
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 src/auto/link.sed
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 src/auto/pathdef.c
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 # Windows
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 *.exe
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 *.idb
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 *.exp
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 *.map
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 *.obj
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 *.pdb
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 *.ilk
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 *.sln
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 *.suo
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 *.res
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 *.RES
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 vim*.dll
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 vim*.lib
17157
bbd454d155a9 patch 8.1.1578: MS-Windows: pathdef.c should depend on build options
Bram Moolenaar <Bram@vim.org>
parents: 16606
diff changeset
40 src/dobj*/pathdef.c
bbd454d155a9 patch 8.1.1578: MS-Windows: pathdef.c should depend on build options
Bram Moolenaar <Bram@vim.org>
parents: 16606
diff changeset
41 src/gobj*/pathdef.c
bbd454d155a9 patch 8.1.1578: MS-Windows: pathdef.c should depend on build options
Bram Moolenaar <Bram@vim.org>
parents: 16606
diff changeset
42 src/obj*/pathdef.c
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 src/Obj*/pathdef.c
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 gvimext.dll
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 gvimext.lib
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 gvim.lib
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 runtime/doc/uganda.nsis.txt
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 nsis/icons/*
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
49 /vim90/
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
50 .vscode/
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 # NetBeans
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 nbproject/*
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 # Mac OSX
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 src/xxd/xxd.dSYM
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
57 .DS_Store
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59 # All platforms
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 *.rej
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 *.orig
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 *.mo
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 *.swp
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 *~
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 *.pyc
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 *.log
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 src/po/vim.pot
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
68 src/tags
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
69 /tags
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
70 /GPATH
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
71 /GTAGS
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
72 /GRTAGS
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
73 nsis/tags
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 # Generated by "make test"
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 src/po/*.ck
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 src/po/*.desktop
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 src/testdir/mbyte.vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 src/testdir/mzscheme.vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 src/testdir/lua.vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 src/testdir/small.vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 src/testdir/tiny.vim
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 src/testdir/test*.out
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 src/testdir/test*.failed
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 src/testdir/test.log
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 src/testdir/dostmp/*
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 src/testdir/messages
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 src/testdir/viminfo
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 src/testdir/opt_test.vim
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
90 src/testdir/failed
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
91 src/testdir/starttime
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 runtime/indent/testdir/*.out
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
93 runtime/indent/testdir/*.fail
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 src/memfile_test
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 src/json_test
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 src/message_test
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 src/kword_test
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 # Generated by "make install"
19093
af70e0c2b3cd patch 8.2.0107: hgignore is out of sync from gitignore
Bram Moolenaar <Bram@vim.org>
parents: 17157
diff changeset
100 runtime/doc/doctags
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 # Generated by "make shadow". The directory names could be anything but we
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 # restrict them to shadow (the default) or shadow-*
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 src/shadow
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105 src/shadow-*
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106 src/runtime
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 src/pixmaps
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
109 # other files possibly created by tools
16574
cabfcd0f8012 patch 8.1.1290: .hgignore and .gitignore are either distributed or in git
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 src/cscope.out
32041
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
111
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
112 # Linter/language server files
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
113 /.cache/clangd/
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
114 /.ccls-cache/
7aeaf20e2ba5 patch 9.0.1352: "ignore" files are outdated
Bram Moolenaar <Bram@vim.org>
parents: 24689
diff changeset
115 /compile_commands.json