]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.267 v7.3.267
authorBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2011 17:34:59 +0000 (19:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 4 Aug 2011 17:34:59 +0000 (19:34 +0200)
Problem:    Ruby on Mac OS X 10.7 may crash.
Solution:   Avoid alloc(0). (Bjorn Winckler)

src/if_ruby.c
src/version.c

index a45269d6e6f376431ef04f9a40c87036bf9bec4a..5dc32858be4798cc5b95c4448e2d2f0107af2d4e 100644 (file)
@@ -761,11 +761,19 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str)
     char *buff, *p;
 
     str = rb_obj_as_string(str);
-    buff = ALLOCA_N(char, RSTRING_LEN(str));
-    strcpy(buff, RSTRING_PTR(str));
-    p = strchr(buff, '\n');
-    if (p) *p = '\0';
-    MSG(buff);
+    if (RSTRING_LEN(str) > 0)
+    {
+       /* Only do this when the string isn't empty, alloc(0) causes trouble. */
+       buff = ALLOCA_N(char, RSTRING_LEN(str));
+       strcpy(buff, RSTRING_PTR(str));
+       p = strchr(buff, '\n');
+       if (p) *p = '\0';
+       MSG(buff);
+    }
+    else
+    {
+       MSG("");
+    }
     return Qnil;
 }
 
index f6471cf4497a8688535e35b21ec22f9996cdb416..6bddff0cc0243a8127411cbdb3a442f5b5d723de 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    267,
 /**/
     266,
 /**/