summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.3.156
blob: ec873242e9546fb80092f680d78860292c433452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
To: vim_dev@googlegroups.com
Subject: Patch 7.3.156
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.156
Problem:    Tty names possibly left unterminated.
Solution:   Use vim_strncpy() instead of strncpy().
Files:	    src/pty.c


*** ../vim-7.3.155/src/pty.c	2010-08-15 21:57:28.000000000 +0200
--- src/pty.c	2011-04-11 14:02:49.000000000 +0200
***************
*** 209,216 ****
  #ifdef _SEQUENT_
      fvhangup(s);
  #endif
!     strncpy(PtyName, m, sizeof(PtyName));
!     strncpy(TtyName, s, sizeof(TtyName));
      initmaster(f);
      *ttyn = TtyName;
      return f;
--- 209,216 ----
  #ifdef _SEQUENT_
      fvhangup(s);
  #endif
!     vim_strncpy((char_u *)PtyName, (char_u *)m, sizeof(PtyName) - 1);
!     vim_strncpy((char_u *)TtyName, (char_u *)s, sizeof(TtyName) - 1);
      initmaster(f);
      *ttyn = TtyName;
      return f;
***************
*** 301,307 ****
  	return -1;
      }
      signal(SIGCHLD, sigcld);
!     strncpy(TtyName, m, sizeof(TtyName));
      initmaster(f);
      *ttyn = TtyName;
      return f;
--- 301,307 ----
  	return -1;
      }
      signal(SIGCHLD, sigcld);
!     vim_strncpy((char_u *)TtyName, (char_u *)m, sizeof(TtyName) - 1);
      initmaster(f);
      *ttyn = TtyName;
      return f;
***************
*** 326,332 ****
      /* a dumb looking loop replaced by mycrofts code: */
      if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
  	return -1;
!     strncpy(TtyName, ttyname(f), sizeof(TtyName));
      if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
      {
  	close(f);
--- 326,332 ----
      /* a dumb looking loop replaced by mycrofts code: */
      if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
  	return -1;
!     vim_strncpy((char_u *)TtyName, (char_u *)ttyname(f), sizeof(TtyName) - 1);
      if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
      {
  	close(f);
*** ../vim-7.3.155/src/version.c	2011-04-11 13:46:07.000000000 +0200
--- src/version.c	2011-04-11 14:23:38.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     156,
  /**/

-- 
I think that you'll agree that engineers are very effective in their social
interactions.  It's the "normal" people who are nuts.
				(Scott Adams - The Dilbert principle)

 /// 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    ///