Fix: int overflow

This commit is contained in:
Dorian Zedler 2022-07-23 18:07:13 +02:00
parent 94dc4821ba
commit 504c8662eb
Signed by: dorian
GPG key ID: 989DE36109AFA354
2 changed files with 2 additions and 2 deletions

View file

@ -126,6 +126,6 @@ void md2_second_loop(uint8_t* messageDigestBuf);
* @param messageDigestBuf the message digest buffer
* @param i the index of the 16-byte message block
*/
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, int i);
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, size_t i);
#endif // MD2_COMMON_H

View file

@ -117,7 +117,7 @@ void md2_second_loop(uint8_t* messageDigestBuf) {
SECOND_LOOP_END_MARK
}
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, int i) {
void md2_first_loop(const uint8_t* buf, uint8_t* messageDigestBuf, size_t i) {
FIRST_LOOP_START_MARK
for (int j = 0; j < 16; j++) {
messageDigestBuf[16 + j] = buf[i * 16 + j];