mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
vim-patch:8.2.0099: use of NULL pointer when out of memory
Problem: Use of NULL pointer when out of memory.
Solution: Check for NULL pointer. (Dominique Pelle, closes vim/vim#5449)
8b7aa2f9b2
This commit is contained in:
@@ -4715,8 +4715,7 @@ ExpandFromContext (
|
|||||||
int free_pat = FALSE;
|
int free_pat = FALSE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* for ":set path=" and ":set tags=" halve backslashes for escaped
|
// for ":set path=" and ":set tags=" halve backslashes for escaped space
|
||||||
* space */
|
|
||||||
if (xp->xp_backslash != XP_BS_NONE) {
|
if (xp->xp_backslash != XP_BS_NONE) {
|
||||||
free_pat = TRUE;
|
free_pat = TRUE;
|
||||||
pat = vim_strsave(pat);
|
pat = vim_strsave(pat);
|
||||||
@@ -4984,8 +4983,7 @@ static void expand_shellcmd(char_u *filepat, int *num_file, char_u ***file,
|
|||||||
int ret;
|
int ret;
|
||||||
bool did_curdir = false;
|
bool did_curdir = false;
|
||||||
|
|
||||||
/* for ":set path=" and ":set tags=" halve backslashes for escaped
|
// for ":set path=" and ":set tags=" halve backslashes for escaped space
|
||||||
* space */
|
|
||||||
pat = vim_strsave(filepat);
|
pat = vim_strsave(filepat);
|
||||||
for (i = 0; pat[i]; ++i)
|
for (i = 0; pat[i]; ++i)
|
||||||
if (pat[i] == '\\' && pat[i + 1] == ' ')
|
if (pat[i] == '\\' && pat[i + 1] == ' ')
|
||||||
|
Reference in New Issue
Block a user