1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Tty names possibly left unterminated.
12 Solution: Use vim_strncpy() instead of strncpy().
16 *** ../vim-7.3.155/src/pty.c 2010-08-15 21:57:28.000000000 +0200
17 --- src/pty.c 2011-04-11 14:02:49.000000000 +0200
23 ! strncpy(PtyName, m, sizeof(PtyName));
24 ! strncpy(TtyName, s, sizeof(TtyName));
32 ! vim_strncpy((char_u *)PtyName, (char_u *)m, sizeof(PtyName) - 1);
33 ! vim_strncpy((char_u *)TtyName, (char_u *)s, sizeof(TtyName) - 1);
41 signal(SIGCHLD, sigcld);
42 ! strncpy(TtyName, m, sizeof(TtyName));
49 signal(SIGCHLD, sigcld);
50 ! vim_strncpy((char_u *)TtyName, (char_u *)m, sizeof(TtyName) - 1);
56 /* a dumb looking loop replaced by mycrofts code: */
57 if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
59 ! strncpy(TtyName, ttyname(f), sizeof(TtyName));
60 if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
64 /* a dumb looking loop replaced by mycrofts code: */
65 if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
67 ! vim_strncpy((char_u *)TtyName, (char_u *)ttyname(f), sizeof(TtyName) - 1);
68 if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
71 *** ../vim-7.3.155/src/version.c 2011-04-11 13:46:07.000000000 +0200
72 --- src/version.c 2011-04-11 14:23:38.000000000 +0200
76 { /* Add new patch number below this line */
82 I think that you'll agree that engineers are very effective in their social
83 interactions. It's the "normal" people who are nuts.
84 (Scott Adams - The Dilbert principle)
86 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
87 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
88 \\\ an exciting new programming language -- http://www.Zimbu.org ///
89 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///