properly left-justify bit strings less than 32 bits.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11057
dc483132-0cff-0310-8789-
dd5450dbe970
Thu Dec 3 19:41:06 1998 Tom Yu <tlyu@mit.edu>
+
+ * 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
}
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;
}