Skip to content

Commit

Permalink
fix: arc4_getword integer overflow, detected by -fsanitize=undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
jackerli(李剑) authored and azat committed Oct 3, 2022
1 parent 117ee9a commit b5b4c7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ arc4_getword(void)
{
unsigned int val;

val = arc4_getbyte() << 24;
val = (unsigned)arc4_getbyte() << 24;
val |= arc4_getbyte() << 16;
val |= arc4_getbyte() << 8;
val |= arc4_getbyte();
Expand Down

0 comments on commit b5b4c7f

Please sign in to comment.