aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb4/cr_ciph.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/krb4/cr_ciph.c')
-rw-r--r--src/lib/krb4/cr_ciph.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/krb4/cr_ciph.c b/src/lib/krb4/cr_ciph.c
index d15a4e0..d9c7512 100644
--- a/src/lib/krb4/cr_ciph.c
+++ b/src/lib/krb4/cr_ciph.c
@@ -71,6 +71,17 @@ create_ciph(c, session, service, instance, realm, life, kvno, tkt,
ptr = (char *) c->dat;
+ if(sizeof(c->dat) / 8 < (8 +
+ strlen(service) + 1 +
+ strlen(instance) + 1 +
+ strlen(realm) + 1 +
+ 1 + 1 + 1 +
+ tkt->length + 4 +
+ 7) / 8) {
+ c->length = 0;
+ return(KFAILURE);
+ }
+
memcpy(ptr, (char *) session, 8);
ptr += 8;