# HG changeset patch # User Bram Moolenaar # Date 1288177103 -7200 # Node ID f2927225367a3ac3fbe86d6d03ebb7a526072ed9 # Parent 73d947c20291fd857fba24ddf4725b9b831188eb 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) diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -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); - - /* 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; + 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; + + KeyTyped = FALSE; /* Don't do p_wc completion. */ + redrawcmd(); + goto cmdline_changed; + } } } beep_flush(); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 39, +/**/ 38, /**/ 37,