From: Tom Yu Date: Fri, 4 Dec 1998 03:16:56 +0000 (+0000) Subject: * asn1_k_decode.c (asn1_decode_krb5_flags): Fix previous to X-Git-Tag: krb5-1.1-beta1~463 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d8df800c97ae727767b8725faa65b849e4c61cb0;p=krb5.git * asn1_k_decode.c (asn1_decode_krb5_flags): Fix previous to properly left-justify bit strings less than 32 bits. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11057 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/asn.1/ChangeLog b/src/lib/krb5/asn.1/ChangeLog index a3d98ad5f..52e04d26f 100644 --- a/src/lib/krb5/asn.1/ChangeLog +++ b/src/lib/krb5/asn.1/ChangeLog @@ -1,5 +1,9 @@ Thu Dec 3 19:41:06 1998 Tom Yu + + * asn1_k_decode.c (asn1_decode_krb5_flags): Fix previous to + properly left-justify bit strings less than 32 bits. + * asn1_k_decode.c (asn1_decode_krb5_flags): Modify to deal with BIT STRING values that are not exactly 32 bits. Throw away bits beyond number 31 in a bit string for now. Deal with masking out diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 226b0443d..090fcc3d9 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -298,8 +298,11 @@ asn1_error_code asn1_decode_krb5_flags(buf, val) } if (length <= 4) { /* Mask out unused bits, but only if necessary. */ - f &= ~0 << unused; + f &= ~(krb5_flags)0 << unused; } + /* left-justify */ + if (length < 4) + f <<= (4 - length) * 8; *val = f; return 0; }