diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-06-22 13:19:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 13:19:03 -0600 |
commit | c94325288a1008b5eabe7ae0fd03aa906686ee1b (patch) | |
tree | 76128f4b149ac19519678a7d7e98a74535e86a07 /src/nvim/api/options.c | |
parent | b20b28249b1c58698be09c5b9d6785cfb1b12fb3 (diff) | |
download | rneovim-c94325288a1008b5eabe7ae0fd03aa906686ee1b.tar.gz rneovim-c94325288a1008b5eabe7ae0fd03aa906686ee1b.tar.bz2 rneovim-c94325288a1008b5eabe7ae0fd03aa906686ee1b.zip |
fix(api): check error after getting win/buf handle (#19052)
Diffstat (limited to 'src/nvim/api/options.c')
-rw-r--r-- | src/nvim/api/options.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index 3067a6e6b4..19ce25f676 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -43,6 +43,9 @@ static int validate_option_value_args(Dict(option) *opts, int *scope, int *opt_t if (opts->win.type == kObjectTypeInteger) { *opt_type = SREQ_WIN; *from = find_window_by_handle((int)opts->win.data.integer, err); + if (ERROR_SET(err)) { + return FAIL; + } } else if (HAS_KEY(opts->win)) { api_set_error(err, kErrorTypeValidation, "invalid value for key: win"); return FAIL; @@ -52,6 +55,9 @@ static int validate_option_value_args(Dict(option) *opts, int *scope, int *opt_t *scope = OPT_LOCAL; *opt_type = SREQ_BUF; *from = find_buffer_by_handle((int)opts->buf.data.integer, err); + if (ERROR_SET(err)) { + return FAIL; + } } else if (HAS_KEY(opts->buf)) { api_set_error(err, kErrorTypeValidation, "invalid value for key: buf"); return FAIL; |