summaryrefslogtreecommitdiffstats
path: root/src/kdc/fakeka.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2008-10-24 20:07:00 +0000
committerGreg Hudson <ghudson@mit.edu>2008-10-24 20:07:00 +0000
commitfcf15c482b582c4f2e5dd7c6222c4e3509bbb7d6 (patch)
tree9ce89cc387b4bee641f0f25e818371b90731fdb6 /src/kdc/fakeka.c
parent4d901a092a69a69be251131174166fc661d13633 (diff)
downloadkrb5-fcf15c482b582c4f2e5dd7c6222c4e3509bbb7d6.tar.gz
krb5-fcf15c482b582c4f2e5dd7c6222c4e3509bbb7d6.tar.xz
krb5-fcf15c482b582c4f2e5dd7c6222c4e3509bbb7d6.zip
Use strlcpy instead of strcpy in many places
ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20919 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kdc/fakeka.c')
-rw-r--r--src/kdc/fakeka.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/kdc/fakeka.c b/src/kdc/fakeka.c
index 21344596e..f861d48ed 100644
--- a/src/kdc/fakeka.c
+++ b/src/kdc/fakeka.c
@@ -51,6 +51,7 @@
#include <com_err.h>
#include <kerberosIV/krb.h>
#include <kerberosIV/des.h>
+#include <k5-platform.h>
#ifndef LINT
static char rcsid[]=
@@ -778,14 +779,14 @@ packet_t req, reply;
* Initialize these so we don't crash trying to print them in
* case they don't get filled in.
*/
- strcpy(rname, "Unknown");
- strcpy(rinst, "Unknown");
- strcpy(sname, "Unknown");
- strcpy(sinst, "Unknown");
- strcpy(cname, "Unknown");
- strcpy(cinst, "Unknown");
- strcpy(cell, "Unknown");
- strcpy(realm, "Unknown");
+ strlcpy(rname, "Unknown", sizeof(rname));
+ strlcpy(rinst, "Unknown", sizeof(rinst));
+ strlcpy(sname, "Unknown", sizeof(sname));
+ strlcpy(sinst, "Unknown", sizeof(sinst));
+ strlcpy(cname, "Unknown", sizeof(cname));
+ strlcpy(cinst, "Unknown", sizeof(cinst));
+ strlcpy(cell, "Unknown", sizeof(cell));
+ strlcpy(realm, "Unknown", sizeof(realm));
p = req->base;
maxn = req->len;
@@ -797,7 +798,7 @@ packet_t req, reply;
GET_PSTR(cell);
if (!cell[0])
- strcpy(cell, localcell);
+ strlcpy(cell, localcell, sizeof(cell));
if (debug)
fprintf(stderr, "Cell is %s\n", cell);
@@ -963,7 +964,7 @@ packet_t req, reply;
(strcasecmp(cell, localcell) == 0)) {
char *c;
- strcpy(rinst, localcell);
+ strlcpy(rinst, localcell, sizeof(rinst));
for (c = rinst; *c != NULL; c++)
*c = (char) tolower( (int) *c);