svn rev #21914: trunk/src/lib/crypto/aes/

raeburn@MIT.EDU raeburn at MIT.EDU
Mon Feb 9 11:07:43 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21914
Commit By: raeburn
Log Message:
use unsigned value for shifting, avoiding undefined behavior


Changed Files:
U   trunk/src/lib/crypto/aes/aes_s2k.c
Modified: trunk/src/lib/crypto/aes/aes_s2k.c
===================================================================
--- trunk/src/lib/crypto/aes/aes_s2k.c	2009-02-09 15:57:58 UTC (rev 21913)
+++ trunk/src/lib/crypto/aes/aes_s2k.c	2009-02-09 16:07:42 UTC (rev 21914)
@@ -53,7 +53,7 @@
 	/* The first two need casts in case 'int' is 16 bits.  */
 	iter_count = load_32_be(p);
 	if (iter_count == 0) {
-	    iter_count = (1L << 16) << 16;
+	    iter_count = (1UL << 16) << 16;
 	    if (((iter_count >> 16) >> 16) != 1)
 		return KRB5_ERR_BAD_S2K_PARAMS;
 	}




More information about the cvs-krb5 mailing list