You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ gcc -fsanitize=undefined,address md5_test.c md5.c
$ ./a.out
md5.c:43:78: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
The text was updated successfully, but these errors were encountered:
The read from
data
is promoted toint
, and so the left shift by 24 inmd5.c
may cause signed overflow. This requires cast to anunsigned int
:UBSan reveals this in the tests:
The text was updated successfully, but these errors were encountered: