0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.3.039

Problem:    Crash when using skk.vim plugin.
Solution:   Get length of expression evaluation result only after checking for
            NULL.  (Noriaki Yagi, Dominique Pelle)
This commit is contained in:
Bram Moolenaar 2010-10-27 12:58:23 +02:00
parent 264e9fd61b
commit fc3c83e47e
2 changed files with 19 additions and 14 deletions

View File

@ -688,24 +688,27 @@ getcmdline(firstc, count, indent)
p = get_expr_line();
--textlock;
restore_cmdline(&save_ccline);
len = (int)STRLEN(p);
if (p != NULL && realloc_cmdbuff(len + 1) == OK)
if (p != NULL)
{
ccline.cmdlen = len;
STRCPY(ccline.cmdbuff, p);
vim_free(p);
len = (int)STRLEN(p);
if (realloc_cmdbuff(len + 1) == OK)
{
ccline.cmdlen = len;
STRCPY(ccline.cmdbuff, p);
vim_free(p);
/* Restore the cursor or use the position set with
* set_cmdline_pos(). */
if (new_cmdpos > ccline.cmdlen)
ccline.cmdpos = ccline.cmdlen;
else
ccline.cmdpos = new_cmdpos;
/* Restore the cursor or use the position set with
* set_cmdline_pos(). */
if (new_cmdpos > ccline.cmdlen)
ccline.cmdpos = ccline.cmdlen;
else
ccline.cmdpos = new_cmdpos;
KeyTyped = FALSE; /* Don't do p_wc completion. */
redrawcmd();
goto cmdline_changed;
KeyTyped = FALSE; /* Don't do p_wc completion. */
redrawcmd();
goto cmdline_changed;
}
}
}
beep_flush();

View File

@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
39,
/**/
38,
/**/