To: vim_dev@googlegroups.com Subject: Patch 7.4.1680 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1680 Problem: Coverity warns for not checking name length (false positive). Solution: Only copy the characters we know are there. Files: src/channel.c *** ../vim-7.4.1679/src/channel.c 2016-03-28 19:16:15.661846574 +0200 --- src/channel.c 2016-03-28 22:33:50.745627750 +0200 *************** *** 2284,2294 **** channel_part_info(channel_T *channel, dict_T *dict, char *name, int part) { chanpart_T *chanpart = &channel->ch_part[part]; ! char namebuf[20]; size_t tail; char *s = ""; ! STRCPY(namebuf, name); STRCAT(namebuf, "_"); tail = STRLEN(namebuf); --- 2284,2294 ---- channel_part_info(channel_T *channel, dict_T *dict, char *name, int part) { chanpart_T *chanpart = &channel->ch_part[part]; ! char namebuf[20]; /* longest is "sock_timeout" */ size_t tail; char *s = ""; ! vim_strncpy((char_u *)namebuf, (char_u *)name, 4); STRCAT(namebuf, "_"); tail = STRLEN(namebuf); *** ../vim-7.4.1679/src/version.c 2016-03-28 22:30:46.795497938 +0200 --- src/version.c 2016-03-28 22:35:33.752580468 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1680, /**/ -- Send $25.00 for handy leaflet on how to make money by selling leaflets /// 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 ///