Hi

The following command crashes vim-7.3a (2249:4620acaf4814):

$ vim -u NONE --noplugin -c ':ownsyntax foo'

==2575== Invalid read of size 1
==2575==    at 0x80FB394: vim_strsave (misc2.c:1234)
==2575==    by 0x8084FA1: set_internal_string_var (eval.c:994)
==2575==    by 0x81710CA: ex_ownsyntax (syntax.c:6201)
==2575==    by 0x80A5A70: do_one_cmd (ex_docmd.c:2640)
==2575==    by 0x80A2810: do_cmdline (ex_docmd.c:1109)
==2575==    by 0x80A5E88: do_cmdline_cmd (ex_docmd.c:715)
==2575==    by 0x80D9D16: main (main.c:2755)
==2575==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

Attached patch fixes it but I'm not familiar enough with the new
:ownsyntax command to test it properly.

-- 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 4620acaf4814 src/syntax.c
--- a/src/syntax.c	Sun Jun 06 17:41:24 2010 +0200
+++ b/src/syntax.c	Sun Jun 06 22:26:23 2010 +0200
@@ -6198,7 +6198,8 @@
 
     /* move value of b:current_syntax to w:current_syntax */
     new_value = get_var_value((char_u *)"b:current_syntax");
-    set_internal_string_var((char_u *)"w:current_syntax", new_value);
+    if (new_value != NULL)
+	set_internal_string_var((char_u *)"w:current_syntax", new_value);
 
     /* restore value of b:current_syntax */
     if (old_value != NULL)

Raspunde prin e-mail lui