0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.3585: crash when passing float to "term_rows" of term_start()

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)
This commit is contained in:
Bram Moolenaar
2021-11-12 16:01:15 +00:00
parent 58ef8a31d7
commit 8813739673
4 changed files with 13 additions and 2 deletions

View File

@@ -4473,7 +4473,8 @@ static VTermStateFallbacks state_fallbacks = {
static void *
vterm_malloc(size_t size, void *data UNUSED)
{
return alloc_clear(size);
// make sure that the length is not zero
return alloc_clear(size == 0 ? 1L : size);
}
static void