diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-16 17:09:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-16 17:09:07 +0000 |
commit | 7cd754d04eab0796fee90fb5d2fc6d2691799fce (patch) | |
tree | 407ba6a15346d73e405382622af16b561633ef73 /kerberosIV/krb/getrealm.c | |
parent | 26c0143d817536c8335c7ec2dc28925082f46f39 (diff) |
strncat related oflows
Diffstat (limited to 'kerberosIV/krb/getrealm.c')
-rw-r--r-- | kerberosIV/krb/getrealm.c | 6 |
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 */ } |