diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-08-06 15:42:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-08-06 15:42:06 +0200 |
commit | bae5a17a738d1a3b5c51d9aa5d99e228d3911955 (patch) | |
tree | 8e5eade690175963af3c749a4c368acf3b346164 /src/ops.c | |
parent | cae92dc3d5bdd4009910671328cd01394bfbe2cf (diff) | |
download | vim-git-bae5a17a738d1a3b5c51d9aa5d99e228d3911955.tar.gz |
patch 8.0.0879: crash when shifting with huge numberv8.0.0879
Problem: Crash when shifting with huge number.
Solution: Check for overflow. (Dominique Pelle, closes #1945)
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -396,7 +396,10 @@ shift_block(oparg_T *oap, int amount) return; /* total is number of screen columns to be inserted/removed */ - total = amount * p_sw; + total = (int)((unsigned)amount * (unsigned)p_sw); + if ((total / p_sw) != amount) + return; /* multiplication overflow */ + oldp = ml_get_curline(); if (!left) |