summaryrefslogtreecommitdiff
path: root/kerberosIV/krb/mk_auth.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1997-12-09 07:57:43 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1997-12-09 07:57:43 +0000
commiteded21a00a253859f474c1bcca5d418a3c82948f (patch)
tree94e38e1e18679c1a1a5af56a04c549d26eb42255 /kerberosIV/krb/mk_auth.c
parent49ac4cb4369b59297c067ed22daacd240c981029 (diff)
Removed one expliotable hole, one possibly exploitable hole, many buffer
overflows and lots of unchecked pointers. Tags are nice too.
Diffstat (limited to 'kerberosIV/krb/mk_auth.c')
-rw-r--r--kerberosIV/krb/mk_auth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kerberosIV/krb/mk_auth.c b/kerberosIV/krb/mk_auth.c
index 343f05acc80..196e085e782 100644
--- a/kerberosIV/krb/mk_auth.c
+++ b/kerberosIV/krb/mk_auth.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: mk_auth.c,v 1.2 1997/12/09 07:57:28 art Exp $ */
/* $KTH: mk_auth.c,v 1.4 1997/04/01 08:18:35 joda Exp $ */
/*
@@ -63,11 +64,15 @@ krb_mk_auth(int32_t options,
char realrealm[REALM_SZ];
int ret;
unsigned char *p;
+ char *tmp;
if (options & KOPT_DONT_CANON)
- strncpy(realinst, instance, sizeof(realinst));
+ tmp = instance;
else
- strncpy(realinst, krb_get_phost (instance), sizeof(realinst));
+ tmp = krb_get_phost (instance);
+
+ strncpy(realinst, tmp, sizeof(realinst));
+ realinst[sizeof(realinst) - 1] = '\0';
if (realm == NULL) {
ret = krb_get_lrealm (realrealm, 1);