comparison src/insexpand.c @ 29408:c12fb2c5b1b3 v9.0.0046

patch 9.0.0046: reading past end of completion with duplicate match Commit: https://github.com/vim/vim/commit/baefde14550231f6468ac2ed2ed495bc381c0c92 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 7 19:59:49 2022 +0100 patch 9.0.0046: reading past end of completion with duplicate match Problem: Reading past end of completion with duplicate match. Solution: Check string length
author Bram Moolenaar <Bram@vim.org>
date Thu, 07 Jul 2022 21:00:03 +0200
parents 979ce206409a
children 722a50132db9
comparison
equal deleted inserted replaced
29407:a46aa8d84416 29408:c12fb2c5b1b3
784 match = compl_first_match; 784 match = compl_first_match;
785 do 785 do
786 { 786 {
787 if (!match_at_original_text(match) 787 if (!match_at_original_text(match)
788 && STRNCMP(match->cp_str, str, len) == 0 788 && STRNCMP(match->cp_str, str, len) == 0
789 && match->cp_str[len] == NUL) 789 && ((int)STRLEN(match->cp_str) <= len
790 || match->cp_str[len] == NUL))
790 return NOTDONE; 791 return NOTDONE;
791 match = match->cp_next; 792 match = match->cp_next;
792 } while (match != NULL && !is_first_match(match)); 793 } while (match != NULL && !is_first_match(match));
793 } 794 }
794 795