To: vim_dev@googlegroups.com Subject: Patch 8.0.1517 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1517 Problem: Invalid memory acces with pattern using look-behind match. (Dominique Pelle) Solution: Get a pointer to the right line. Files: src/regexp.c *** ../vim-8.0.1516/src/regexp.c 2018-02-10 18:45:21.084822043 +0100 --- src/regexp.c 2018-02-13 16:28:11.106080820 +0100 *************** *** 5585,5593 **** { #ifdef FEAT_MBYTE if (has_mbyte) rp->rs_un.regsave.rs_u.pos.col -= ! (*mb_head_off)(regline, regline + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; else #endif --rp->rs_un.regsave.rs_u.pos.col; --- 5585,5598 ---- { #ifdef FEAT_MBYTE if (has_mbyte) + { + char_u *line = + reg_getline(behind_pos.rs_u.pos.lnum); + rp->rs_un.regsave.rs_u.pos.col -= ! (*mb_head_off)(line, line + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; + } else #endif --rp->rs_un.regsave.rs_u.pos.col; *** ../vim-8.0.1516/src/version.c 2018-02-13 15:17:49.078578173 +0100 --- src/version.c 2018-02-13 16:34:39.159396037 +0100 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1517, /**/ -- FATHER: You killed eight wedding guests in all! LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady. FATHER: I can understand that. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///