summaryrefslogtreecommitdiffstats
path: root/src/vim9type.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-27 17:25:05 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-27 17:25:05 +0000
commit56310d38d8e866085108c7b77b756f4373d5122a (patch)
tree1976b6a184bd84128c0caee19358e09efafa65e4 /src/vim9type.c
parentb9a1edfc5434f2a3ac50b1a178d3c85aa417b798 (diff)
patch 9.0.1104: invalid memory access when checking function argument typesv9.0.1104
Problem: Invalid memory access when checking function argument types. Solution: Do not check beyond the number of arguments. (closes #11755)
Diffstat (limited to 'src/vim9type.c')
-rw-r--r--src/vim9type.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vim9type.c b/src/vim9type.c
index 0709ce0437..393c69d7e7 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -848,7 +848,7 @@ check_type_maybe(
{
int i;
- for (i = 0; i < expected->tt_argcount; ++i)
+ for (i = 0; i < expected->tt_argcount && i < actual->tt_argcount; ++i)
// Allow for using "any" argument type, lambda's have them.
if (actual->tt_args[i] != &t_any && check_type(
expected->tt_args[i], actual->tt_args[i], FALSE,