Skip to content

Commit

Permalink
Kernel: Don't left-shift 1 (signed) 31 times
Browse files Browse the repository at this point in the history
Found by KUBSAN :^)
  • Loading branch information
awesomekling committed Feb 5, 2021
1 parent 4c0707e commit 930e3ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Random.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class FortunaPRNG {
HashType new_key;
new_key.update(m_key);
for (size_t i = 0; i < pool_count; ++i) {
if (m_reseed_number % (1 << i) == 0) {
if (m_reseed_number % (1u << i) == 0) {
DigestType digest = m_pools[i].digest();
new_key.update(digest.immutable_data(), digest.data_length());
}
Expand Down

0 comments on commit 930e3ce

Please sign in to comment.