comparison src/term.c @ 28618:daad4c7b39be v8.2.4833

patch 8.2.4833: failure of mapping not checked for Commit: https://github.com/vim/vim/commit/12e21e387b5bbc928097abf1c189b7dc665838fc Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Apr 27 11:58:01 2022 +0100 patch 8.2.4833: failure of mapping not checked for Problem: Failure of mapping not checked for. Solution: Check return value of ins_typebuf(). (closes https://github.com/vim/vim/issues/10299)
author Bram Moolenaar <Bram@vim.org>
date Wed, 27 Apr 2022 13:00:03 +0200
parents 6ff407067190
children 3f4e1326a003
comparison
equal deleted inserted replaced
28617:eeb5a2b3f9c6 28618:daad4c7b39be
4529 if (extra < 0) 4529 if (extra < 0)
4530 // remove matched chars, taking care of noremap 4530 // remove matched chars, taking care of noremap
4531 del_typebuf(-extra, offset); 4531 del_typebuf(-extra, offset);
4532 else if (extra > 0) 4532 else if (extra > 0)
4533 // insert the extra space we need 4533 // insert the extra space we need
4534 ins_typebuf(string + slen, REMAP_YES, offset, FALSE, FALSE); 4534 if (ins_typebuf(string + slen, REMAP_YES, offset, FALSE, FALSE)
4535 == FAIL)
4536 return FAIL;
4535 4537
4536 // Careful: del_typebuf() and ins_typebuf() may have reallocated 4538 // Careful: del_typebuf() and ins_typebuf() may have reallocated
4537 // typebuf.tb_buf[]! 4539 // typebuf.tb_buf[]!
4538 mch_memmove(typebuf.tb_buf + typebuf.tb_off + offset, string, 4540 mch_memmove(typebuf.tb_buf + typebuf.tb_off + offset, string,
4539 (size_t)new_slen); 4541 (size_t)new_slen);