]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0739: [security]: use-after-free in ex_getln.c v9.1.0739
authorJohn Marriott <basilisk@internode.on.net>
Sat, 21 Sep 2024 09:39:02 +0000 (11:39 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 21 Sep 2024 09:39:02 +0000 (11:39 +0200)
Problem:  [security]: use-after-free in ex_getln.c
Solution: free pointer p a bit later (John Marriott)

closes: #15712

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_getln.c
src/version.c

index 1b3a699a21eab1ba44ebd1f7f36714efffcdcf25..b4c7941013436f0f2921935449183870b3ccf6a6 100644 (file)
@@ -3330,7 +3330,6 @@ realloc_cmdbuff(int len)
     // there, thus copy up to the NUL and add a NUL.
     mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen);
     ccline.cmdbuff[ccline.cmdlen] = NUL;
-    vim_free(p);
 
     if (ccline.xpc != NULL
            && ccline.xpc->xp_pattern != NULL
@@ -3345,6 +3344,8 @@ realloc_cmdbuff(int len)
            ccline.xpc->xp_pattern = ccline.cmdbuff + i;
     }
 
+    vim_free(p);
+
     return OK;
 }
 
index ff2b77f0f1bb5a64f5ede2a166be57f46fda2f58..f4b75547115804513f381a2316d2fbf88d24f246 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    739,
 /**/
     738,
 /**/