From 504c8662ebca45e23054ae28f402a13b36339bea Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sat, 23 Jul 2022 18:07:13 +0200 Subject: [PATCH] Fix: int overflow --- Implementierung/lib/md2_impls/md2_common.h | 2 +- Implementierung/src/md2_impls/md2_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Implementierung/lib/md2_impls/md2_common.h b/Implementierung/lib/md2_impls/md2_common.h index 663c0d4..80a014f 100644 --- a/Implementierung/lib/md2_impls/md2_common.h +++ b/Implementierung/lib/md2_impls/md2_common.h @@ -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 \ No newline at end of file diff --git a/Implementierung/src/md2_impls/md2_common.c b/Implementierung/src/md2_impls/md2_common.c index 7128922..04dcf0e 100644 --- a/Implementierung/src/md2_impls/md2_common.c +++ b/Implementierung/src/md2_impls/md2_common.c @@ -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];