Issue1567

Title integer undefined behaviors in libgcrypt
Priority bug Status resolved
Category Due Date
Version 1.5.3 ExtLink  (go)
Superseder Nosy List regehr
Assigned To Topics nobug  (help)

Created on 2013-11-12.05:21:19 by [P] regehr, last changed 2014-08-18.07:01:03 by werner.

Messages
msg4855 (view) Author: werner Date: 2013-11-15.07:28:08
No, they are not.  This is the specification of the algorithm.
msg4849 (view) Author: regehr Date: 2013-11-12.05:21:19
Below are some undefined behaviors found in libgcrypt by Clang 3.3's undefined 
behavior sanitizer during the course of a "make check".  The first two are 
potentially serious, the rest are probably benign for now.

cast5.c:386:27: runtime error: shift exponent 32 is too large for 32-bit type 
'u32' (aka 'unsigned int')
cast5.c:439:27: runtime error: shift exponent 32 is too large for 32-bit type 
'u32' (aka 'unsigned int')

blowfish.c:416:17: runtime error: left shift of 254 by 24 places cannot be 
represented in type 'int'
blowfish.c:417:17: runtime error: left shift of 170 by 24 places cannot be 
represented in type 'int'
blowfish.c:443:17: runtime error: left shift of 225 by 24 places cannot be 
represented in type 'int'
blowfish.c:444:17: runtime error: left shift of 244 by 24 places cannot be 
represented in type 'int'
cast5.c:368:18: runtime error: left shift of 152 by 24 places cannot be 
represented in type 'int'
cast5.c:369:18: runtime error: left shift of 137 by 24 places cannot be 
represented in type 'int'
cast5.c:428:18: runtime error: left shift of 152 by 24 places cannot be 
represented in type 'int'
cast5.c:429:18: runtime error: left shift of 132 by 24 places cannot be 
represented in type 'int'
cast5.c:585:18: runtime error: left shift of 144 by 24 places cannot be 
represented in type 'int'
cast5.c:587:18: runtime error: left shift of 152 by 24 places cannot be 
represented in type 'int'
cast5.c:588:18: runtime error: left shift of 156 by 24 places cannot be 
represented in type 'int'
des.c:497:3: runtime error: left shift of 242 by 24 places cannot be represented 
in type 'int'
des.c:497:3: runtime error: left shift of 246 by 24 places cannot be represented 
in type 'int'
des.c:628:3: runtime error: left shift of 255 by 24 places cannot be represented 
in type 'int'
des.c:745:3: runtime error: left shift of 182 by 24 places cannot be represented 
in type 'int'
des.c:745:3: runtime error: left shift of 254 by 24 places cannot be represented 
in type 'int'
twofish.c:787:3: runtime error: left shift of 131 by 24 places cannot be 
represented in type 'int'
twofish.c:788:3: runtime error: left shift of 158 by 24 places cannot be 
represented in type 'int'
twofish.c:789:3: runtime error: left shift of 171 by 24 places cannot be 
represented in type 'int'
twofish.c:790:3: runtime error: left shift of 230 by 24 places cannot be 
represented in type 'int'
twofish.c:830:3: runtime error: left shift of 131 by 24 places cannot be 
represented in type 'int'
twofish.c:831:3: runtime error: left shift of 133 by 24 places cannot be 
represented in type 'int'
twofish.c:832:3: runtime error: left shift of 163 by 24 places cannot be 
represented in type 'int'
twofish.c:833:3: runtime error: left shift of 195 by 24 places cannot be 
represented in type 'int'
History
Date User Action Args
2014-08-18 07:01:03wernersetstatus: chatting -> resolved
2013-11-15 07:28:08wernersettopic: + nobug
status: unread -> chatting
messages: + msg4855
2013-11-12 05:21:19regehrcreate