To: vim_dev@googlegroups.com Subject: Patch 8.0.1047 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1047 Problem: Buffer overflow in Ruby. Solution: Allocate one more byte. (Dominique Pelle) Files: src/if_ruby.c *** ../vim-8.0.1046/src/if_ruby.c 2017-01-29 23:11:21.172512839 +0100 --- src/if_ruby.c 2017-09-03 15:15:04.459997942 +0200 *************** *** 984,990 **** 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'; --- 984,990 ---- 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) + 1); strcpy(buff, RSTRING_PTR(str)); p = strchr(buff, '\n'); if (p) *p = '\0'; *** ../vim-8.0.1046/src/version.c 2017-09-03 15:04:16.684172761 +0200 --- src/version.c 2017-09-03 15:15:00.828021326 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1047, /**/ -- I'm trying to be an optimist, but I don't think it'll work. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///