From 4c6238b3d9a18bc5ac0bb0ebde1dc2d47f7cdb22 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 2 Apr 2004 12:12:01 +0000 Subject: [PATCH] restore-original-size-test-20040402 feeling like an idiot. the original test compared the size of the ticket field in the ktc_token struct allocated by the app which might be smaller than the size of the field defined in the library --- src/auth/ktc_nt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/auth/ktc_nt.c b/src/auth/ktc_nt.c index 67834d5b7..af070fa0b 100644 --- a/src/auth/ktc_nt.c +++ b/src/auth/ktc_nt.c @@ -538,8 +538,12 @@ ktc_GetToken(struct ktc_principal *server, struct ktc_token *token, /* user name is here */ - /* check that ticket will fit */ - if (MAXKTCTICKETLEN < ticketLen) + /* check that ticket will fit + * this compares the size of the ktc_token allocated by the app + * which might be smaller than the current definition of MAXKTCTICKETLEN + */ + maxLen = tokenLen - sizeof(struct ktc_token) + MAXKTCTICKETLEN; + if (maxLen < ticketLen) return KTC_TOOBIG; /* set return values */ -- 2.39.5