|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current code is using the same variable name twice, k1, in two different scopes.
A cursory inspection of the code looks like one is trying to sneak a vulnerability by
masking off the reset of the k1 variable out of the loop; which is, in fact, what the
official algorithm does explicitely.
I guess this is a result of the C89-ization of the official algorithm, with the second
k1 variable usually defined AFTER the loop.
This change brings more sanity to the algorithm, making it much better-looking by
removing all ambiguity in what we're doing. The end result is exactly the same, but
at least we're explicit about it.
|