| To: vim-dev@vim.org |
| Subject: Patch 7.1.174 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.1.174 |
| Problem: Writing NUL past end of a buffer. |
| Solution: Copy one byte less when using strncat(). (Dominuque Pelle) |
| Files: src/ex_cmds.c, src/ex_docmd.c |
| |
| |
| |
| |
| |
| *** 1650,1656 **** |
| { |
| vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "), |
| errnum, message); |
| ! STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff)); |
| if (IObuff[STRLEN(IObuff) - 1] == '\n') |
| IObuff[STRLEN(IObuff) - 1] = NUL; |
| emsg(IObuff); |
| --- 1650,1656 ---- |
| { |
| vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "), |
| errnum, message); |
| ! STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff) - 1); |
| if (IObuff[STRLEN(IObuff) - 1] == '\n') |
| IObuff[STRLEN(IObuff) - 1] = NUL; |
| emsg(IObuff); |
| |
| |
| |
| *** 2660,2666 **** |
| errormsg = IObuff; |
| } |
| STRCAT(errormsg, ": "); |
| ! STRNCAT(errormsg, *cmdlinep, IOSIZE - STRLEN(IObuff)); |
| } |
| emsg(errormsg); |
| } |
| --- 2660,2666 ---- |
| errormsg = IObuff; |
| } |
| STRCAT(errormsg, ": "); |
| ! STRNCAT(errormsg, *cmdlinep, IOSIZE - STRLEN(IObuff) - 1); |
| } |
| emsg(errormsg); |
| } |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 174, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 214. Your MCI "Circle of Friends" are all Hayes-compatible. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |