comparison src/register.c @ 25917:79a5c8238a5d v8.2.3492

patch 8.2.3492: crash when pasting too many times Commit: https://github.com/vim/vim/commit/eeed1c7ae090c17f4df51cf97b2a9e4d8b4f4dc7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 10 12:35:17 2021 +0100 patch 8.2.3492: crash when pasting too many times Problem: Crash when pasting too many times. Solution: Limit the size to what fits in an int. (closes https://github.com/vim/vim/issues/8962)
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 Oct 2021 13:45:04 +0200
parents 196f75cf6983
children b863efc63397
comparison
equal deleted inserted replaced
25916:52792b298baf 25917:79a5c8238a5d
2009 getvcol(curwin, &pos, NULL, &vcol, NULL); 2009 getvcol(curwin, &pos, NULL, &vcol, NULL);
2010 } 2010 }
2011 } 2011 }
2012 2012
2013 do { 2013 do {
2014 totlen = count * yanklen; 2014 long multlen = count * yanklen;
2015 if (totlen > 0) 2015
2016 totlen = multlen;
2017 if (totlen != multlen)
2018 {
2019 emsg(_(e_resulting_text_too_long));
2020 break;
2021 }
2022 else if (totlen > 0)
2016 { 2023 {
2017 oldp = ml_get(lnum); 2024 oldp = ml_get(lnum);
2018 if (lnum > start_lnum) 2025 if (lnum > start_lnum)
2019 { 2026 {
2020 pos_T pos; 2027 pos_T pos;