summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-29 22:28:46 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-29 22:28:46 +0100
commita8bfa1727a370d659dc0ccc3f0fd1763b10b5457 (patch)
tree17834c1ce84410330af2cae7feecfb589fd5880a /src/os_unix.c
parent1ea88a3e12e5f6afc5353cd0d6e6d4f4a89ced94 (diff)
downloadvim-git-a8bfa1727a370d659dc0ccc3f0fd1763b10b5457.tar.gz
patch 8.1.0661: clipboard regexp might be used recursivelyv8.1.0661
Problem: Clipboard regexp might be used recursively. Solution: Check for recursive use and bail out.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index eaf07f101..ec12f3ea7 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1688,9 +1688,15 @@ x_connect_to_server(void)
if (x_no_connect)
return FALSE;
- /* Check for a match with "exclude:" from 'clipboard'. */
+ // Check for a match with "exclude:" from 'clipboard'.
if (clip_exclude_prog != NULL)
{
+ // Just in case we get called recursively, return FALSE. This could
+ // happen if vpeekc() is used while executing the prog and it causes a
+ // related callback to be invoked.
+ if (regprog_in_use(clip_exclude_prog))
+ return FALSE;
+
if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
return FALSE;
}