summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/getrealm.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-16 17:09:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-16 17:09:07 +0000
commit7cd754d04eab0796fee90fb5d2fc6d2691799fce (patch)
tree407ba6a15346d73e405382622af16b561633ef73 /kerberosIV/krb/getrealm.c
parent26c0143d817536c8335c7ec2dc28925082f46f39 (diff)
strncat related oflows
Diffstat (limited to 'kerberosIV/krb/getrealm.c')
-rw-r--r--kerberosIV/krb/getrealm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kerberosIV/krb/getrealm.c b/kerberosIV/krb/getrealm.c
index 10a3b20610c..45ab920d575 100644
--- a/kerberosIV/krb/getrealm.c
+++ b/kerberosIV/krb/getrealm.c
@@ -83,9 +83,9 @@ krb_realmofhost(host)
if ((trans_file = fopen(KRB_RLM_TRANS, "r")) == (FILE *) 0) {
char tbuf[128];
char *tdir = (char *) getenv("KRBCONFDIR");
- strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf));
- strncat(tbuf, "/krb.realms", sizeof(tbuf));
- tbuf[sizeof(tbuf)-1] = 0;
+ strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf)-1);
+ tbuf[sizeof(tbuf)-1] = '\0';
+ strncat(tbuf, "/krb.realms", sizeof(tbuf) - strlen(tbuf));
if ((trans_file = fopen(tbuf,"r")) == NULL)
return(ret_realm[0] ? ret_realm : NULL); /* krb_errno = KRB_NO_TRANS */
}