mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.1492: using uninitialized memory when argument is missing
Problem: Using uninitialized memory when argument is missing. Solution: Check there are sufficient arguments before the base. (closes #12302)
This commit is contained in:
@@ -1626,8 +1626,14 @@ check_internal_func_args(
|
||||
|
||||
if (method_call && argoff > 1)
|
||||
{
|
||||
isn_T *isn = generate_instr(cctx, ISN_SHUFFLE);
|
||||
if (argcount < argoff)
|
||||
{
|
||||
semsg(_(e_not_enough_arguments_for_function_str),
|
||||
internal_func_name(func_idx));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
isn_T *isn = generate_instr(cctx, ISN_SHUFFLE);
|
||||
if (isn == NULL)
|
||||
return FAIL;
|
||||
isn->isn_arg.shuffle.shfl_item = argcount;
|
||||
|
Reference in New Issue
Block a user