mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
fix(runtime): do not allow breakcheck inside runtime path calculation
problem: breakcheck might run arbitrary lua code, which might require modules and thus invoke runtime path calculation recursively. solution: Block the use of breakcheck when expanding glob patterns inside 'runtimepath' fixes #23012
This commit is contained in:
@@ -620,7 +620,7 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
|
||||
static int stardepth = 0; // depth for "**" expansion
|
||||
|
||||
// Expanding "**" may take a long time, check for CTRL-C.
|
||||
if (stardepth > 0) {
|
||||
if (stardepth > 0 && !(flags & EW_NOBREAK)) {
|
||||
os_breakcheck();
|
||||
if (got_int) {
|
||||
return 0;
|
||||
@@ -701,7 +701,8 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
|
||||
if (flags & (EW_NOERROR | EW_NOTWILD)) {
|
||||
emsg_silent++;
|
||||
}
|
||||
regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
|
||||
bool nobreak = (flags & EW_NOBREAK);
|
||||
regmatch.regprog = vim_regcomp(pat, RE_MAGIC | (nobreak ? RE_NOBREAK : 0));
|
||||
if (flags & (EW_NOERROR | EW_NOTWILD)) {
|
||||
emsg_silent--;
|
||||
}
|
||||
|
Reference in New Issue
Block a user