]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1131: potential out-of-memory issue in search.c v9.1.1131
authorJohn Marriott <basilisk@internode.on.net>
Fri, 21 Feb 2025 18:59:56 +0000 (19:59 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 21 Feb 2025 18:59:56 +0000 (19:59 +0100)
commitb79fa3d9c8a08f15267797511d779e33bd33e68e
treee03197d91c1e5aafb08bfdb40d3cbaee271f45d2
parenta48693c6c2a1e85639bc9f14a92c1d9c9dbd6231
patch 9.1.1131: potential out-of-memory issue in search.c

Problem:  potential out-of-memory issue in search.c
Solution: improve situation and refactor search.c slightly
          (John Marriott)

- In function update_search_stat():
  add a check for a theoretical null pointer reference, set and remember
  the length of lastpat, remove the three calls to STRLEN() and use the
  various string's associated lengths instead, add a check for an
  out-of-memory condition.

- In function search_for_fuzz_match():
  remove a call to strnsave() and thus avoid having to add a check for
  an out-of-memory condition, also replace the call to STRLEN() by
  ml_get_buf_len().

closes: #16689

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/search.c
src/version.c