* ftpd.c: strcat -> strncat
authorTom Yu <tlyu@mit.edu>
Sat, 13 Feb 1999 02:12:29 +0000 (02:12 +0000)
committerTom Yu <tlyu@mit.edu>
Sat, 13 Feb 1999 02:12:29 +0000 (02:12 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11172 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index 8a0dbc8e078a4cc709ac283b2b9e2c27f78f83b0..bf2c78968c5868d8e6167154aacace4b797dcaf0 100644 (file)
@@ -1,3 +1,7 @@
+Fri Feb 12 21:11:18 1999  Tom Yu  <tlyu@mit.edu>
+
+       * ftpd.c: strcat -> strncat
+
 1998-11-13  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in: Set the myfulldir and mydir variables (which are
index db424a597189c79c8ca4abef92fedb1dadb5966a..897a81433569d8cddd24fb0b178183b7fcd88418 100644 (file)
@@ -596,7 +596,8 @@ path_expand(path)
                        }
                }
        }
-       return strcat(pathbuf, path);
+       return strncat(pathbuf, path,
+                      sizeof (pathbuf) - strlen(pathbuf) - 1);
 }
 
 /*
@@ -728,11 +729,13 @@ user(name)
 #endif /* KRB5_KRB4_COMPAT */
 
                if (!authorized && authlevel == AUTHLEVEL_AUTHORIZE) {
-                       strcat(buf, "; Access denied.");
+                       strncat(buf, "; Access denied.",
+                               sizeof(buf) - strlen(buf) - 1);
                        result = 530;
                        pw = NULL;
                } else if (!authorized || (want_creds && !have_creds)) {
-                       strcat(buf, "; Password required.");
+                       strncat(buf, "; Password required.",
+                               sizeof(buf) - strlen(buf) - 1);
                        askpasswd = 1;
                        result = 331;
                } else
@@ -1611,7 +1614,7 @@ statcmd()
                sprintf(&str[strlen(str)], ", FORM: %s", formnames[form]);
        if (type == TYPE_L)
 #if 1
-               strcat(str, " 8");
+               strncat(str, " 8", sizeof (str) - strlen(str) - 1);
 #else
 /* this is silly. -- eichin@cygnus.com */
 #if NBBY == 8
@@ -1681,7 +1684,7 @@ reply(n, fmt, p0, p1, p2, p3, p4, p5)
                int length, kerror;
                if (n) sprintf(in, "%d%c", n, cont_char);
                else in[0] = '\0';
-               strcat(in, buf);
+               strncat(in, buf, sizeof (in) - strlen(in) - 1);
 #ifdef KRB5_KRB4_COMPAT
                if (strcmp(auth_type, "KERBEROS_V4") == 0) {
                        if ((length = clevel == PROT_P ?