4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash for substitute() call using submatch(1) while there is no
12 such submatch. (Yukihiro Nakadaira)
13 Solution: Also check the start of the submatch is set, it can be NULL when
14 an attempted match didn't work out.
18 *** ../vim-7.2.112/src/regexp.c Fri Aug 8 13:45:31 2008
19 --- src/regexp.c Sat Feb 21 21:46:49 2009
23 if (!REG_MULTI) /* Single-line regexp */
25 ! if (reg_endp[no] == NULL)
27 /* Backref was not set: Match an empty string. */
31 if (!REG_MULTI) /* Single-line regexp */
33 ! if (reg_startp[no] == NULL || reg_endp[no] == NULL)
35 /* Backref was not set: Match an empty string. */
40 else /* Multi-line regexp */
42 ! if (reg_endpos[no].lnum < 0)
44 /* Backref was not set: Match an empty string. */
48 else /* Multi-line regexp */
50 ! if (reg_startpos[no].lnum < 0 || reg_endpos[no].lnum < 0)
52 /* Backref was not set: Match an empty string. */
59 ! if (submatch_match->endp[no] == NULL)
63 - s = submatch_match->startp[no];
64 retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s));
73 ! s = submatch_match->startp[no];
74 ! if (s == NULL || submatch_match->endp[no] == NULL)
77 retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s));
81 *** ../vim-7.2.112/src/version.c Sat Feb 21 21:22:44 2009
82 --- src/version.c Sat Feb 21 22:01:56 2009
86 { /* Add new patch number below this line */
92 hundred-and-one symptoms of being an internet addict:
93 103. When you find yourself in the "Computer" section of Barnes & Noble
96 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
97 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
98 \\\ download, build and distribute -- http://www.A-A-P.org ///
99 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///