Anonymous avatar Anonymous committed 7fb8cdb

updated for version 7.3.156
Problem: Tty names possibly left unterminated.
Solution: Use vim_strncpy() instead of strncpy().

Comments (0)

Files changed (2)

 #ifdef _SEQUENT_
     fvhangup(s);
 #endif
-    strncpy(PtyName, m, sizeof(PtyName));
-    strncpy(TtyName, s, sizeof(TtyName));
+    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;
 	return -1;
     }
     signal(SIGCHLD, sigcld);
-    strncpy(TtyName, m, sizeof(TtyName));
+    vim_strncpy((char_u *)TtyName, (char_u *)m, sizeof(TtyName) - 1);
     initmaster(f);
     *ttyn = TtyName;
     return f;
     /* 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));
+    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);
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    156,
+/**/
     155,
 /**/
     154,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.