Patch 8.2.0099
Problem:    Use of NULL pointer when out of memory.
Solution:   Check for NULL pointer. (Dominique Pelle, closes #5449)
Files:      src/cmdexpand.c


*** ../vim-8.2.0098/src/cmdexpand.c     2020-01-05 22:05:46.448380159 +0100
--- src/cmdexpand.c     2020-01-07 21:04:40.183631093 +0100
***************
*** 2327,2333 ****
      char_u    *path = NULL;
      int               mustfree = FALSE;
      garray_T    ga;
!     char_u    *buf = alloc(MAXPATHL);
      size_t    l;
      char_u    *s, *e;
      int               flags = flagsarg;
--- 2327,2333 ----
      char_u    *path = NULL;
      int               mustfree = FALSE;
      garray_T    ga;
!     char_u    *buf;
      size_t    l;
      char_u    *s, *e;
      int               flags = flagsarg;
***************
*** 2337,2348 ****
      hashitem_T        *hi;
      hash_T    hash;
  
      if (buf == NULL)
        return FAIL;
  
!     // for ":set path=" and ":set tags=" halve backslashes for escaped
!     // space
      pat = vim_strsave(filepat);
      for (i = 0; pat[i]; ++i)
        if (pat[i] == '\\' && pat[i + 1] == ' ')
            STRMOVE(pat + i, pat + i + 1);
--- 2337,2354 ----
      hashitem_T        *hi;
      hash_T    hash;
  
+     buf = alloc(MAXPATHL);
      if (buf == NULL)
        return FAIL;
  
!     // for ":set path=" and ":set tags=" halve backslashes for escaped space
      pat = vim_strsave(filepat);
+     if (pat == NULL)
+     {
+       vim_free(buf);
+       return FAIL;
+     }
+ 
      for (i = 0; pat[i]; ++i)
        if (pat[i] == '\\' && pat[i + 1] == ' ')
            STRMOVE(pat + i, pat + i + 1);
*** ../vim-8.2.0098/src/version.c       2020-01-07 20:59:30.528926519 +0100
--- src/version.c       2020-01-07 21:05:31.467422596 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     99,
  /**/

-- 
How do you know when you have run out of invisible ink?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202001072012.007KC9Yj007324%40masaka.moolenaar.net.

Raspunde prin e-mail lui