summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-06-29 12:30:50 +0000
committernoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-06-29 12:30:50 +0000
commitbbd69fc3e300540308642d205e0e9dd2d3dd431f (patch)
treef19d8d8efc7b3a4ff6263ce500716c2372602e51
parent716a80d6c8ec93cc493c845a98d1212cc2a25f10 (diff)
downloadcryptopp-bbd69fc3e300540308642d205e0e9dd2d3dd431f.tar.gz
Static analysis showed the unsigned int y is truncated to an unsigned char via _rotr16. It does not appear to be a problem with the library, but it may be a problem for users. The assert will alert in Debug builds (but not Release builds)
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@557 57ff6487-cd31-0410-9ec3-f628ee90f5f0
-rw-r--r--misc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/misc.h b/misc.h
index 009c26e..5b778c7 100644
--- a/misc.h
+++ b/misc.h
@@ -708,6 +708,7 @@ template<> inline word16 rotlFixed<word16>(word16 x, unsigned int y)
template<> inline word16 rotrFixed<word16>(word16 x, unsigned int y)
{
assert(y < 8*sizeof(x));
+ assert(y <= 255);
return y ? _rotr16(x, y) : x;
}