aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/runtime.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-04-17 13:08:53 +0200
committerbfredl <bjorn.linse@gmail.com>2023-04-19 16:34:15 +0200
commitaee6f08ce12a62e9104892702a658a8d3daee4df (patch)
tree3a9e9b6f0e546fe3f685a1de2a074118ed19c860 /src/nvim/runtime.c
parent7bf1a917b78ebc622b6691af9196b95b4a9d3142 (diff)
downloadrneovim-aee6f08ce12a62e9104892702a658a8d3daee4df.tar.gz
rneovim-aee6f08ce12a62e9104892702a658a8d3daee4df.tar.bz2
rneovim-aee6f08ce12a62e9104892702a658a8d3daee4df.zip
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
Diffstat (limited to 'src/nvim/runtime.c')
-rw-r--r--src/nvim/runtime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 401139a89a..a6ed5c7410 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -470,7 +470,8 @@ int do_in_cached_path(char *name, int flags, DoInRuntimepathCB callback, void *c
}
int ew_flags = ((flags & DIP_DIR) ? EW_DIR : EW_FILE)
- | (flags & DIP_DIRFILE) ? (EW_DIR|EW_FILE) : 0;
+ | ((flags & DIP_DIRFILE) ? (EW_DIR|EW_FILE) : 0)
+ | EW_NOBREAK;
// Expand wildcards, invoke the callback for each match.
char *(pat[]) = { buf };
@@ -670,7 +671,7 @@ static void expand_rtp_entry(RuntimeSearchPath *search_path, Map(String, handle_
int num_files;
char **files;
char *(pat[]) = { entry };
- if (gen_expand_wildcards(1, pat, &num_files, &files, EW_DIR) == OK) {
+ if (gen_expand_wildcards(1, pat, &num_files, &files, EW_DIR | EW_NOBREAK) == OK) {
for (int i = 0; i < num_files; i++) {
push_path(search_path, rtp_used, files[i], after);
}