From: Jeffrey Altman Date: Fri, 2 Apr 2004 12:12:01 +0000 (+0000) Subject: restore-original-size-test-20040402 X-Git-Tag: openafs-devel-1_3_63~19 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=4c6238b3d9a18bc5ac0bb0ebde1dc2d47f7cdb22;p=packages%2Fo%2Fopenafs.git 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 --- 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 */