summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/get_krbrlm.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/get_krbrlm.c
parent26c0143d817536c8335c7ec2dc28925082f46f39 (diff)
strncat related oflows
Diffstat (limited to 'kerberosIV/krb/get_krbrlm.c')
-rw-r--r--kerberosIV/krb/get_krbrlm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kerberosIV/krb/get_krbrlm.c b/kerberosIV/krb/get_krbrlm.c
index 77e82ece4bc..ee4a06efdb1 100644
--- a/kerberosIV/krb/get_krbrlm.c
+++ b/kerberosIV/krb/get_krbrlm.c
@@ -55,9 +55,9 @@ krb_get_lrealm(r, n)
if ((cnffile = fopen(KRB_CONF, "r")) == NULL) {
char tbuf[128];
char *tdir = (char *) getenv("KRBCONFDIR");
- strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf));
- strncat(tbuf, "/krb.conf", sizeof(tbuf));
+ strncpy(tbuf, tdir ? tdir : "/etc", sizeof(tbuf)-1);
tbuf[sizeof(tbuf)-1] = 0;
+ strncat(tbuf, "/krb.conf", sizeof(tbuf)-strlen(tbuf));
if ((cnffile = fopen(tbuf,"r")) == NULL)
return(KFAILURE);
}