auth: Don't overflow cell string
[openafs.git] / src / auth / ktc.c
index fc25636..4df513d 100644 (file)
@@ -701,7 +701,7 @@ GetToken(struct ktc_principal *aserver, struct ktc_token *atoken,
 
                if (aclient || aviceid) {
                    if (aclient) {
-                       strcpy(aclient->cell, cellp);
+                       strlcpy(aclient->cell, cellp, sizeof(aclient->cell));
                        aclient->instance[0] = 0;
                    }
 
@@ -969,7 +969,7 @@ ktc_ListTokens(int aprevIndex,
     tp += temp;                        /* skip clear token itself */
     tp += sizeof(afs_int32);   /* skip primary flag */
     /* tp now points to the cell name */
-    strcpy(aserver->cell, tp);
+    strlcpy(aserver->cell, tp, sizeof(aserver->cell));
     aserver->instance[0] = 0;
     strcpy(aserver->name, "afs");
 #endif /* NO_AFS_CLIENT */