vim/backport-find-test-fails.patch
ExtinctFire a1622b8443 fix CVE-2021-3973 CVE-2021-3974
Signed-off-by: ExtinctFire <shenyining_00@126.com>
(cherry picked from commit 20e53e3a69bad745d01299378ff5fdac9b08aa22)
2021-12-01 11:31:46 +08:00

34 lines
877 B
Diff

From e015d99abb4276f47ce97bad1ad5ff0c658b1c8a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Wed, 17 Nov 2021 19:01:53 +0000
Subject: [PATCH] patch 8.2.3613: :find test fails
Problem: :find test fails.
Solution: Put length check inside if block.
Reference:https://github.com/vim/vim/commit/e015d99abb4276f47ce97bad1ad5ff0c658b1c8a
---
src/findfile.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/findfile.c b/src/findfile.c
index 7a4dfe5..b9a0e47 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -1727,11 +1727,11 @@ find_file_in_path_option(
proc->pr_WindowPtr = (APTR)-1L;
# endif
- if (len == 0)
- return NULL;
-
if (first == TRUE)
{
+ if (len == 0)
+ return NULL;
+
// copy file name into NameBuff, expanding environment variables
save_char = ptr[len];
ptr[len] = NUL;
--
2.23.0