summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-11-12 16:01:15 +0000
committerBram Moolenaar <Bram@vim.org>2021-11-12 16:01:15 +0000
commit88137396733896eb5e49c2b3b73d9a496d6ce49a (patch)
tree8936266d7e935049de2916b29ee2aaeb4a09f074 /src/job.c
parent58ef8a31d7087d495ab1582be5b7a22796ac2451 (diff)
downloadvim-git-88137396733896eb5e49c2b3b73d9a496d6ce49a.tar.gz
patch 8.2.3585: crash when passing float to "term_rows" of term_start()v8.2.3585
Problem: Crash when passing float to "term_rows" in the options argument of term_start(). (Virginia Senioria) Solution: Bail out if the argument is not a number. (closes #9116)
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/job.c b/src/job.c
index fcb482c70..80cb47eeb 100644
--- a/src/job.c
+++ b/src/job.c
@@ -424,10 +424,14 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
}
else if (STRCMP(hi->hi_key, "term_rows") == 0)
{
+ int error = FALSE;
+
if (!(supported2 & JO2_TERM_ROWS))
break;
opt->jo_set2 |= JO2_TERM_ROWS;
- opt->jo_term_rows = tv_get_number(item);
+ opt->jo_term_rows = tv_get_number_chk(item, &error);
+ if (error)
+ return FAIL;
}
else if (STRCMP(hi->hi_key, "term_cols") == 0)
{