Patch 8.2.0034

10 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 23, 2019, 12:19:53 PM12/23/19
to vim...@googlegroups.com

Patch 8.2.0034
Problem: Missing check for out of memory.
Solution: Check for NULL after vim_strsave(). (Dominique Pelle,
closes #5393)
Files: src/filepath.c


*** ../vim-8.2.0033/src/filepath.c 2019-12-08 20:49:06.000000000 +0100
--- src/filepath.c 2019-12-23 18:17:12.072815495 +0100
***************
*** 1658,1664 ****
int limit = 100;

p = vim_strsave(p);
!
if (p[0] == '.' && (vim_ispathsep(p[1])
|| (p[1] == '.' && (vim_ispathsep(p[2])))))
is_relative_to_current = TRUE;
--- 1658,1665 ----
int limit = 100;

p = vim_strsave(p);
! if (p == NULL)
! goto fail;
if (p[0] == '.' && (vim_ispathsep(p[1])
|| (p[1] == '.' && (vim_ispathsep(p[2])))))
is_relative_to_current = TRUE;
***************
*** 1681,1687 ****
--- 1682,1691 ----

buf = alloc(MAXPATHL + 1);
if (buf == NULL)
+ {
+ vim_free(p);
goto fail;
+ }

for (;;)
{
*** ../vim-8.2.0033/src/version.c 2019-12-22 19:40:36.910100058 +0100
--- src/version.c 2019-12-23 18:18:15.564605656 +0100
***************
*** 744,745 ****
--- 744,747 ----
{ /* Add new patch number below this line */
+ /**/
+ 34,
/**/

--
Q: How does a UNIX Guru do Sex ?
A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages