tyru wrote:

> Here is the step to reproduce SEGV:
> 1. Enter insert mode
> 2. Enter <C-j> (which skk.vim mapped to)
> 3. Enter some text and hit <Space> (which skk.vim mapped to)
> 4. Enter <C-g>
>
> Requirement:
> skk.vim version 0.26.2.
> OS: Ubuntu, Windows XP
>
> In fact, this is not my patch.
> the patch's author is Noriaki Yagi.

Hi Tyru

Thanks for the bug report. Your proposed patch no longer
sets "len" which is thus used uninitialized.

Attached patch fixes it.

Cheers
-- Dominique

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 8fdc12103333 src/ex_getln.c
--- a/src/ex_getln.c	Sun Oct 24 14:33:43 2010 +0200
+++ b/src/ex_getln.c	Mon Oct 25 07:45:38 2010 +0200
@@ -688,24 +688,27 @@
 		    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();

Raspunde prin e-mail lui