Mercurial > vim
diff src/proto/regexp.pro @ 29048:c98fc7a4dde4 v8.2.5046
patch 8.2.5046: vim_regsub() can overwrite the destination
Commit: https://github.com/vim/vim/commit/4aaf3e7f4db599932d01d87e5bbcdc342cccee27
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 30 20:58:55 2022 +0100
patch 8.2.5046: vim_regsub() can overwrite the destination
Problem: vim_regsub() can overwrite the destination.
Solution: Pass the destination length, give an error when it doesn't fit.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 May 2022 22:00:03 +0200 |
parents | bb29b09902d5 |
children | b90bca860b5a |
line wrap: on
line diff
--- a/src/proto/regexp.pro +++ b/src/proto/regexp.pro @@ -6,8 +6,8 @@ char_u *skip_regexp_ex(char_u *startp, i reg_extmatch_T *ref_extmatch(reg_extmatch_T *em); void unref_extmatch(reg_extmatch_T *em); char_u *regtilde(char_u *source, int magic); -int vim_regsub(regmatch_T *rmp, char_u *source, typval_T *expr, char_u *dest, int copy, int magic, int backslash); -int vim_regsub_multi(regmmatch_T *rmp, linenr_T lnum, char_u *source, char_u *dest, int copy, int magic, int backslash); +int vim_regsub(regmatch_T *rmp, char_u *source, typval_T *expr, char_u *dest, int destlen, int flags); +int vim_regsub_multi(regmmatch_T *rmp, linenr_T lnum, char_u *source, char_u *dest, int destlen, int flags); char_u *reg_submatch(int no); list_T *reg_submatch_list(int no); int vim_regcomp_had_eol(void);