Fix uninitialized loop variable

This commit is contained in:
Juhani Krekelä 2021-04-05 02:15:31 +03:00
parent 96f9b11cf2
commit debac6c434
1 changed files with 1 additions and 1 deletions

2
puer.c
View File

@ -169,7 +169,7 @@ void feed_hash(struct hashstate *state, unsigned char input[], size_t length) {
// Invariant: The buffer will be filled somewhere between 0 and 15
// when we enter this loop. This is because once it reaches 16, the
// hash compression function is executed.
for (size_t i; i < length; i++) {
for (size_t i = 0; i < length; i++) {
// Must not overflow the internat counter. In practice we will not
// hit this.
assert(state->totalbits <= UINT64_MAX - 8);