Mercurial > vim
comparison src/evalfunc.c @ 18576:e9675870c480 v8.1.2282
patch 8.1.2282: crash when passing many arguments through a partial
Commit: https://github.com/vim/vim/commit/4c054e9fb23027b55a09ee647a3a2c91936aeb1b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 10 00:13:50 2019 +0100
patch 8.1.2282: crash when passing many arguments through a partial
Problem: Crash when passing many arguments through a partial. (Andy
Massimino)
Solution: Check the number of arguments. (closes #5186)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 10 Nov 2019 00:15:04 +0100 |
parents | 34d5cd432cac |
children | 3089b422b9dc |
comparison
equal
deleted
inserted
replaced
18575:a5f35d5b839f | 18576:e9675870c480 |
---|---|
2525 goto theend; | 2525 goto theend; |
2526 } | 2526 } |
2527 list = argvars[arg_idx].vval.v_list; | 2527 list = argvars[arg_idx].vval.v_list; |
2528 if (list == NULL || list->lv_len == 0) | 2528 if (list == NULL || list->lv_len == 0) |
2529 arg_idx = 0; | 2529 arg_idx = 0; |
2530 else if (list->lv_len > MAX_FUNC_ARGS) | |
2531 { | |
2532 emsg_funcname((char *)e_toomanyarg, name); | |
2533 vim_free(name); | |
2534 goto theend; | |
2535 } | |
2530 } | 2536 } |
2531 } | 2537 } |
2532 if (dict_idx > 0 || arg_idx > 0 || arg_pt != NULL || is_funcref) | 2538 if (dict_idx > 0 || arg_idx > 0 || arg_pt != NULL || is_funcref) |
2533 { | 2539 { |
2534 partial_T *pt = ALLOC_CLEAR_ONE(partial_T); | 2540 partial_T *pt = ALLOC_CLEAR_ONE(partial_T); |