mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.4255: theoretical computation overflow
Problem: Theoretical computation overflow. Solution: Perform multiplication in a wider type. (closes #9657)
This commit is contained in:
committed by
Bram Moolenaar
parent
f12b7815f6
commit
d5cec1f1f0
@@ -4632,7 +4632,7 @@ garbage_collect(int testing)
|
||||
// Don't make it bigger though.
|
||||
if (exestack.ga_len + n < exestack.ga_maxlen)
|
||||
{
|
||||
new_len = exestack.ga_itemsize * (exestack.ga_len + n);
|
||||
new_len = (size_t)exestack.ga_itemsize * (exestack.ga_len + n);
|
||||
pp = vim_realloc(exestack.ga_data, new_len);
|
||||
if (pp == NULL)
|
||||
return FAIL;
|
||||
|
Reference in New Issue
Block a user