From f92fff61e75c599bd2c9656cd01f24945ac2cf84 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 25 Mar 2011 15:50:06 +0000 Subject: [PATCH] Fix a precedence error in g_make_token_header() which caused it to write the wrong length when no token type is passed. (From r24739 in users/lhoward/moonshot-mechglue-fixes.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24745 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/generic/util_token.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/gssapi/generic/util_token.c b/src/lib/gssapi/generic/util_token.c index 3acbd8e6a..0c4c90c16 100644 --- a/src/lib/gssapi/generic/util_token.c +++ b/src/lib/gssapi/generic/util_token.c @@ -133,7 +133,7 @@ unsigned int g_token_size(const gss_OID_desc * mech, unsigned int body_size) { /* set body_size to sequence contents size */ - body_size += 4 + (int) mech->length; /* NEED overflow check */ + body_size += 4 + (unsigned int)mech->length; /* NEED overflow check */ return(1 + der_length_size(body_size) + body_size); } @@ -148,7 +148,7 @@ g_make_token_header( int tok_type) { *(*buf)++ = 0x60; - der_write_length(buf, (tok_type == -1) ?2:4 + mech->length + body_size); + der_write_length(buf, ((tok_type == -1) ? 2 : 4) + mech->length + body_size); *(*buf)++ = 0x06; *(*buf)++ = (unsigned char) mech->length; TWRITE_STR(*buf, mech->elements, mech->length); -- 2.26.2