[krb5-appl/488]
* krlogin.c (main): Fix up potential buffer overrun.
* krcp.c (hosteq): Fix up potential buffer overrun.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10267
dc483132-0cff-0310-8789-
dd5450dbe970
+Mon Nov 3 15:25:48 1997 Tom Yu <tlyu@mit.edu>
+
+ * krlogind.c (doit): Fix up potential buffer overrun.
+ [krb5-appl/488]
+
+ * krlogin.c (main): Fix up potential buffer overrun.
+
+ * krcp.c (hosteq): Fix up potential buffer overrun.
+
Tue Oct 7 18:01:15 1997 Theodore Y. Ts'o <tytso@mit.edu>
* v4rcp.M: Removed useless .so to a non-existent macro file.
if ((h_ptr = gethostbyname(h1)) == NULL)
return(0);
- strcpy(hname1, h_ptr->h_name);
+ strncpy(hname1, h_ptr->h_name, sizeof (hname1));
+ hname1[sizeof (hname1) - 1] = '\0';
if ((h_ptr = gethostbyname(h2)) == NULL)
return(0);
if (cp == (char *) NULL) cp = getenv("TERM");
- if (cp)
- (void) strcpy(term, cp);
+ if (cp) {
+ (void) strncpy(term, cp, sizeof (term));
+ term[sizeof (term) - 1] = '\0';
+ }
#ifdef POSIX_TERMIOS
if (tcgetattr(0, &ttyb) == 0) {
int ospeed = cfgetospeed (&ttyb);
}
/* Save hostent information.... */
- else strcpy(rhost_name,hp->h_name);
+ else {
+ strncpy(rhost_name,hp->h_name,sizeof (rhost_name));
+ rhost_name[sizeof (rhost_name) - 1] = '\0';
+ }
if (fromp->sin_family != AF_INET)
fatal(f, "Permission denied - Malformed from address\n");