From: Bram Moolenaar Date: Mon, 23 Dec 2019 17:18:52 +0000 (+0100) Subject: patch 8.2.0034: missing check for out of memory X-Git-Tag: v8.2.0034 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70188f5b23ea7efec7adaf74e0af797d1bb1afe8;p=thirdparty%2Fvim.git patch 8.2.0034: missing check for out of memory Problem: Missing check for out of memory. Solution: Check for NULL after vim_strsave(). (Dominique Pelle, closes #5393) --- diff --git a/src/filepath.c b/src/filepath.c index 01d2dcb97b..ef5edae234 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -1658,7 +1658,8 @@ f_resolve(typval_T *argvars, typval_T *rettv) 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,7 +1682,10 @@ f_resolve(typval_T *argvars, typval_T *rettv) buf = alloc(MAXPATHL + 1); if (buf == NULL) + { + vim_free(p); goto fail; + } for (;;) { diff --git a/src/version.c b/src/version.c index 3c2c49bd6d..9f369a95d8 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 34, /**/ 33, /**/